607{
608 if (bufferPtr == nullptr)
609 {
611 }
612
614
615 if (permutationVector.
has_value() && permutationVector.
value().GetSize() > 0)
616 {
619 reinterpret_cast<const T*>(bufferPtr), data.get(), sizeof(T));
620 }
621 else
622 {
623 ::memcpy(data.get(), bufferPtr, tensorInfo.
GetNumBytes());
624 }
625
626 return std::make_pair(ConstTensor(tensorInfo, data.get()), std::move(data));
627}
bool has_value() const noexcept
const TensorShape & GetShape() const
unsigned int GetNumElements() const
unsigned int GetNumBytes() const
armnn::TensorShape Permuted(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)