570 ARMNN_ASSERT_MSG(bufferPtr !=
nullptr, fmt::format(
"Buffer for permutation is null").c_str());
574 if (permutationVector.
has_value() && permutationVector.
value().GetSize() > 0)
578 reinterpret_cast<const T*
>(bufferPtr), data.get(),
sizeof(T));
582 ::memcpy(data.get(), bufferPtr, tensorInfo.
GetNumBytes());
585 return std::make_pair(
ConstTensor(tensorInfo, data.get()), std::move(data));
const TensorShape & GetShape() const
unsigned int GetNumBytes() const
void Permute(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
#define ARMNN_ASSERT_MSG(COND, MSG)
bool has_value() const noexcept
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
armnn::TensorShape Permuted(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)
unsigned int GetNumElements() const