12 #include <arm_compute/core/Coordinates.h>
13 #include <arm_compute/runtime/CL/CLTensor.h>
24 arm_compute::TensorShape shape = armcomputetensorutils::BuildArmComputeTensorShape(subTensorShape);
31 coords.set(i, armnn::numeric_cast<int>(subTensorOrigin[revertedIndex]));
34 const arm_compute::TensorShape parentShape = armcomputetensorutils::BuildArmComputeTensorShape(parent.
GetShape());
38 if (coords.x() != 0 || coords.y() != 0)
42 if ((parentShape.x() != shape.x()) || (parentShape.y() != shape.y()))
47 if (!::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, parentShape, coords, shape))
52 return std::make_unique<ClImportSubTensorHandle>(
53 PolymorphicDowncast<IClTensorHandle*>(&parent), shape, coords);
58 std::unique_ptr<ClImportTensorHandle> tensorHandle = std::make_unique<ClImportTensorHandle>(tensorInfo,
66 std::unique_ptr<ClImportTensorHandle> tensorHandle = std::make_unique<ClImportTensorHandle>(tensorInfo,
73 const bool IsMemoryManaged)
const
84 const bool IsMemoryManaged)
const
116 return m_ExportFlags;
121 return m_ImportFlags;
130 std::vector<Capability> capabilities;
134 capabilities.push_back(paddingCapability);
const FactoryId & GetId() const override
std::vector< Capability > GetCapabilities(const IConnectableLayer *layer, const IConnectableLayer *connectedLayer, CapabilityClass capabilityClass) override
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
MemorySourceFlags GetExportFlags() const override
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override
MemorySourceFlags GetImportFlags() const override
bool SupportsMapUnmap() const override
static const FactoryId & GetIdStatic()
bool SupportsSubTensors() const override
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
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.
Copyright (c) 2021 ARM Limited and Contributors.
CapabilityClass
Capability class to calculate in the GetCapabilities function so that only the capability in the scop...
void IgnoreUnused(Ts &&...)
unsigned int MemorySourceFlags
ITensorHandleFactory::FactoryId FactoryId
constexpr const char * ClImportTensorHandleFactoryId()
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
Capability of the TensorHandleFactory.