10 #include <arm_compute/runtime/CL/CLTensor.h> 11 #include <arm_compute/core/Coordinates.h> 12 #include <arm_compute/runtime/CL/CLSubTensor.h> 14 #include <boost/polymorphic_cast.hpp> 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(
39 if (!::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, parentShape, coords, shape))
44 return std::make_unique<ClSubTensorHandle>(
45 boost::polymorphic_downcast<IClTensorHandle *>(&parent), shape, coords);
60 const bool IsMemoryManaged)
const 62 std::unique_ptr<ClTensorHandle> tensorHandle = std::make_unique<ClTensorHandle>(tensorInfo);
65 tensorHandle->SetMemoryGroup(m_MemoryManager->GetInterLayerMemoryGroup());
72 const bool IsMemoryManaged)
const 74 std::unique_ptr<ClTensorHandle> tensorHandle = std::make_unique<ClTensorHandle>(tensorInfo, dataLayout);
77 tensorHandle->SetMemoryGroup(m_MemoryManager->GetInterLayerMemoryGroup());
100 return m_ExportFlags;
105 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
const FactoryId & GetId() const override