ArmNN
 24.08
NeonTensorHandle.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "NeonTensorHandle.hpp"
7 
9 
10 namespace armnn
11 {
12 std::shared_ptr<ITensorHandle> NeonTensorHandle::DecorateTensorHandle(const TensorInfo &tensorInfo)
13 {
14  auto* parent = const_cast<NeonTensorHandle*>(this);
15  auto decorated = std::make_shared<NeonTensorHandleDecorator>(parent, tensorInfo);
16  m_Decorated.emplace_back(decorated);
17  return decorated;
18 }
19 
21  : m_Original(nullptr), m_TensorInfo()
22 {
23 }
24 
25 NeonTensorDecorator::NeonTensorDecorator(arm_compute::ITensor *parent, const TensorInfo& tensorInfo)
26  : m_Original(nullptr), m_TensorInfo()
27 {
28  m_TensorInfo = armcomputetensorutils::BuildArmComputeTensorInfo(tensorInfo);
29  m_Original = parent;
30 }
31 
32 arm_compute::ITensorInfo* NeonTensorDecorator::info() const
33 {
34  return &m_TensorInfo;
35 }
36 
37 arm_compute::ITensorInfo* NeonTensorDecorator::info()
38 {
39  return &m_TensorInfo;
40 }
41 
43 {
44  return m_Original->buffer();
45 }
46 
47 }
armnn::TensorInfo
Definition: Tensor.hpp:152
NeonTensorHandle.hpp
armnn::NeonTensorDecorator::buffer
uint8_t * buffer() const override
Definition: NeonTensorHandle.cpp:42
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::NeonTensorHandle::DecorateTensorHandle
virtual std::shared_ptr< ITensorHandle > DecorateTensorHandle(const TensorInfo &tensorInfo) override
Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it.
Definition: NeonTensorHandle.cpp:12
ArmComputeTensorUtils.hpp
armnn::NeonTensorDecorator::info
arm_compute::ITensorInfo * info() const override
Definition: NeonTensorHandle.cpp:32
armnn::NeonTensorDecorator::NeonTensorDecorator
NeonTensorDecorator()
Definition: NeonTensorHandle.cpp:20
armnn::NeonTensorHandle
Definition: NeonTensorHandle.hpp:28