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<IClImportTensorHandle*>(&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);
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
MemorySourceFlags GetImportFlags() const override
CapabilityClass
Capability class to calculate in the GetCapabilities function so that only the capability in the scop...
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
MemorySourceFlags GetExportFlags() const override
unsigned int MemorySourceFlags
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
bool SupportsSubTensors() const override
Capability of the TensorHandleFactory.
constexpr const char * ClImportTensorHandleFactoryId()
ITensorHandleFactory::FactoryId FactoryId
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override
const FactoryId & GetId() const override
static const FactoryId & GetIdStatic()
virtual TensorShape GetShape() const =0
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest ite...
std::vector< Capability > GetCapabilities(const IConnectableLayer *layer, const IConnectableLayer *connectedLayer, CapabilityClass capabilityClass) override
bool SupportsMapUnmap() const override
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override