MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / SubTensorInfo

Class SubTensorInfo

arm_compute/core/SubTensorInfo.h:44–276  ·  view source on GitHub ↗

Store the sub tensor's metadata */

Source from the content-addressed store, hash-verified

42{
43/** Store the sub tensor's metadata */
44class SubTensorInfo final : public ITensorInfo
45{
46public:
47 /** Default constructor */
48 SubTensorInfo();
49 /** Default constructor
50 *
51 * @param[in] parent Metadata of parent tensor.
52 * @param[in] tensor_shape Tensor shape. Shape must fit inside parent's shape.
53 * X and Y dimensions must match the parent's ones.
54 * @param[in] coords Coordinates of starting element inside parent tensor.
55 * @param[in] extend_parent (Optional) Extend parent with subtensor shape if subtensor indexes out of bounds
56 */
57 SubTensorInfo(ITensorInfo *parent, TensorShape tensor_shape, Coordinates coords, bool extend_parent = false);
58 /** Default destructor */
59 ~SubTensorInfo() = default;
60 /** Allow instances of this class to be copy constructed */
61 SubTensorInfo(const SubTensorInfo &) = default;
62 /** Allow instances of this class to be copied */
63 SubTensorInfo &operator=(const SubTensorInfo &) = default;
64 /** Allow instances of this class to be move constructed */
65 SubTensorInfo(SubTensorInfo &&) = default;
66 /** Allow instances of this class to be moved */
67 SubTensorInfo &operator=(SubTensorInfo &&) = default;
68 /** Returns the coordinates of the sub-tensor inside the parent tensor
69 *
70 * @return Sub-tensor coordinates
71 */
72 Coordinates coords() const
73 {
74 return _coords;
75 }
76
77 // Inherited methods overridden:
78 std::unique_ptr<ITensorInfo> clone() const override;
79 ITensorInfo &set_data_type(DataType data_type) override
80 {
81 ARM_COMPUTE_ERROR_ON(_parent == nullptr);
82 _parent->set_data_type(data_type);
83 return *this;
84 };
85 ITensorInfo &set_data_layout(const DataLayout &data_layout) override
86 {
87 ARM_COMPUTE_ERROR_ON(_parent == nullptr);
88 _parent->set_data_layout(data_layout);
89 return *this;
90 };
91 ITensorInfo &set_num_channels(int num_channels) override
92 {
93 ARM_COMPUTE_ERROR_ON(_parent == nullptr);
94 _parent->set_num_channels(num_channels);
95 return *this;
96 };
97 ITensorInfo &set_format(Format format) override
98 {
99 ARM_COMPUTE_ERROR_ON(_parent == nullptr);
100 _parent->set_format(format);
101 return *this;

Callers 3

SubTensorMethod · 0.85
CLSubTensorMethod · 0.85
TEST_CASEFunction · 0.85

Calls 1

set_idMethod · 0.80

Tested by

no test coverage detected