608 if (bufferPtr ==
nullptr)
615 if (permutationVector.
has_value() && permutationVector.
value().GetSize() > 0)
619 reinterpret_cast<const T*
>(bufferPtr), data.get(),
sizeof(T));
623 ::memcpy(data.get(), bufferPtr, tensorInfo.
GetNumBytes());
626 return std::make_pair(
ConstTensor(tensorInfo, data.get()), std::move(data));
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
bool has_value() const noexcept
unsigned int GetNumElements() const
const TensorShape & GetShape() const
unsigned int GetNumBytes() const
armnn::TensorShape Permuted(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)
void Permute(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)