TensorShape Class Reference

TensorShape Class Reference#

2 min read time

Applies to Linux

rocCV: roccv::TensorShape Class Reference
roccv::TensorShape Class Reference

TensorShape class. More...

#include <tensor_shape.hpp>

Public Member Functions

const TensorLayoutlayout () const
 Retrieves the layout of the tensor. More...
 
bool operator!= (const TensorShape &rhs) const
 
TensorShapeoperator= (const TensorShape &other)
 
bool operator== (const TensorShape &rhs) const
 
int64_t operator[] (int32_t i) const
 
int size () const
 Returns the size (total number of elements) of the tensor. More...
 
 TensorShape ()=delete
 
 TensorShape (const TensorLayout &layout, const std::initializer_list< const int64_t > shape)
 
 TensorShape (const TensorLayout &layout, const std::span< const int64_t > shape)
 Construct a new Tensor Shape object. More...
 

Detailed Description

TensorShape class.

Constructor & Destructor Documentation

◆ TensorShape() [1/3]

roccv::TensorShape::TensorShape ( )
delete

◆ TensorShape() [2/3]

roccv::TensorShape::TensorShape ( const TensorLayout layout,
const std::span< const int64_t >  shape 
)

Construct a new Tensor Shape object.

Parameters
[in]layoutThe desired layout of the TensorShape object.
[in]shapeAn int64_t array which stores information about the Tensor's shape. For example: given TensorLayout NHWC, an example of an acceptable shape array would be: [1, image.height, image.width, image.channels]. The size of the shape array must reflect the TensorLayout; for example, TENSOR_LAYOUT_HWC would have a shape array of size 3.

◆ TensorShape() [3/3]

roccv::TensorShape::TensorShape ( const TensorLayout layout,
const std::initializer_list< const int64_t >  shape 
)

Member Function Documentation

◆ layout()

const TensorLayout& roccv::TensorShape::layout ( ) const

Retrieves the layout of the tensor.

Returns
Layout of the tensor.

◆ operator!=()

bool roccv::TensorShape::operator!= ( const TensorShape rhs) const

◆ operator=()

TensorShape& roccv::TensorShape::operator= ( const TensorShape other)

◆ operator==()

bool roccv::TensorShape::operator== ( const TensorShape rhs) const

◆ operator[]()

int64_t roccv::TensorShape::operator[] ( int32_t  i) const

◆ size()

int roccv::TensorShape::size ( ) const

Returns the size (total number of elements) of the tensor.

Returns
The size of the tensor.

The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/tensor_shape.hpp