/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/tensor_layout.hpp Source File#
5 min read time
Applies to Linux
tensor_layout.hpp
Go to the documentation of this file.
77 inline static const std::unordered_map<eTensorLayout, TensorLayoutDesc> layoutDescriptorTable = {
78 {TENSOR_LAYOUT_HWC, {3, -1, 1, 0, 2, -1, -1, -1}}, {TENSOR_LAYOUT_NC, {2, 0, -1, -1, 1, -1, -1, -1}},
79 {TENSOR_LAYOUT_NW, {2, 0, 1, -1, -1, -1, -1, -1}}, {TENSOR_LAYOUT_NHWC, {4, 0, 2, 1, 3, -1, -1, -1}},
80 {TENSOR_LAYOUT_NMC, {3, 0, -1, -1, -1, 1, 2, -1}}, {TENSOR_LAYOUT_NMD, {3, 0, -1, -1, -1, 1, 2, -1}},
81 {TENSOR_LAYOUT_LNHWC, {5, 1, 3, 2, 4, -1, -1, 0}}, {TENSOR_LAYOUT_NCHW, {4, 0, 3, 2, 1, -1, -1, -1}},
82 {TENSOR_LAYOUT_N, {1, 0, -1, -1, -1, -1, -1, -1}}, {TENSOR_LAYOUT_NWC, {3, 0, 1, -1, 2, -1, -1, -1}}};
Definition: exception.hpp:31
TensorLayout(eTensorLayout layout)
Construct a new Tensor Layout object.
Definition: tensor_layout.hpp:65
int32_t sift_features_index() const
Index of the sift features dimension specified by layout.
Definition: tensor_layout.hpp:147
bool operator!=(const eTensorLayout &rhs) const
Definition: tensor_layout.hpp:93
bool operator==(const TensorLayout &rhs) const
Definition: tensor_layout.hpp:95
int32_t sift_octave_layer_index() const
Index of the sift octave layer dimension specified by layout.
Definition: tensor_layout.hpp:154
int32_t batch_index() const
Index of the batch dimension specified by layout. E.g. returns 0 for TENSOR_LAYOUT_NHWC.
Definition: tensor_layout.hpp:111
eTensorLayout elayout() const
Returns the layout enum stored in the TensorLayout object.
Definition: tensor_layout.hpp:89
bool operator==(const eTensorLayout &rhs) const
Definition: tensor_layout.hpp:91
int32_t width_index() const
Index of the width dimension specified by layout. E.g. returns 2 for TENSOR_LAYOUT_NHWC.
Definition: tensor_layout.hpp:125
bool operator!=(const TensorLayout &rhs) const
Definition: tensor_layout.hpp:97
int32_t max_features_index() const
Index of the max features dimension specified by layout.
Definition: tensor_layout.hpp:140
int32_t height_index() const
Index of the height dimension specified by layout. E.g. returns 1 for TENSOR_LAYOUT_NHWC.
Definition: tensor_layout.hpp:118
int32_t rank() const
Returns the rank of the Tensor Layout object.
Definition: tensor_layout.hpp:104
int32_t channels_index() const
Index of the channels dimension specified by layout. E.g. returns 3 for TENSOR_LAYOUT_NHWC.
Definition: tensor_layout.hpp:132
static const std::unordered_map< eTensorLayout, TensorLayoutDesc > layoutDescriptorTable
Provides descriptors for each feature of a specified layout type.
Definition: tensor_layout.hpp:77
Definition: strided_data_wrap.hpp:33
Descriptors used to specify features of a specific tensor layout type.
Definition: tensor_layout.hpp:42
int32_t max_features_index
Definition: tensor_layout.hpp:48
int32_t sift_octave_layer_index
Definition: tensor_layout.hpp:50
int32_t sift_features_index
Definition: tensor_layout.hpp:49