12 #include <arm_compute/runtime/CL/CLTensor.h> 13 #include <arm_compute/core/Coordinates.h> 14 #include <arm_compute/runtime/CL/CLSubTensor.h> 24 const unsigned int* subTensorOrigin)
const 27 arm_compute::TensorShape shape = armcomputetensorutils::BuildArmComputeTensorShape(subTensorShape);
34 coords.set(i, boost::numeric_cast<int>(subTensorOrigin[revertedIndex]));
37 const arm_compute::TensorShape parentShape = armcomputetensorutils::BuildArmComputeTensorShape(
42 if (coords.x() != 0 || coords.y() != 0)
46 if ((parentShape.x() != shape.x()) || (parentShape.y() != shape.y()))
51 if (!::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, parentShape, coords, shape))
56 return std::make_unique<ClSubTensorHandle>(
57 PolymorphicDowncast<IClTensorHandle *>(&parent), shape, coords);
72 const bool IsMemoryManaged)
const 74 std::unique_ptr<ClTensorHandle> tensorHandle = std::make_unique<ClTensorHandle>(tensorInfo);
77 tensorHandle->SetMemoryGroup(m_MemoryManager->GetInterLayerMemoryGroup());
84 const bool IsMemoryManaged)
const 86 std::unique_ptr<ClTensorHandle> tensorHandle = std::make_unique<ClTensorHandle>(tensorInfo, dataLayout);
89 tensorHandle->SetMemoryGroup(m_MemoryManager->GetInterLayerMemoryGroup());
112 return m_ExportFlags;
117 return m_ImportFlags;
static const FactoryId & GetIdStatic()
bool SupportsSubTensors() const override
MemorySourceFlags GetImportFlags() const override
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
unsigned int MemorySourceFlags
Copyright (c) 2020 ARM Limited.
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override
MemorySourceFlags GetExportFlags() const override
constexpr const char * ClTensorHandleFactoryId()
ITensorHandleFactory::FactoryId FactoryId
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
virtual TensorShape GetShape() const =0
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest ite...
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
const FactoryId & GetId() const override