ArmNN
 21.02
OutputHandler Class Reference

#include <OutputHandler.hpp>

Public Member Functions

void SetTensorInfo (const TensorInfo &tensorInfo)
 
  • Sets the TensorInfo used by this output handler.
More...
 
void CreateTensorHandles (const IWorkloadFactory &factory, const bool IsMemoryManaged=true)
 
  • Creates tensor handles used by the intermediate tensors.
More...
 
void CreateTensorHandles (const ITensorHandleFactory &factory, const bool IsMemoryManaged=true)
 
const TensorInfoGetTensorInfo () const
  More...
 
ITensorHandleGetData () const
 
  • Gets the allocated tensor memory.
More...
 
void CollectWorkloadOutputs (WorkloadDataCollector &dataCollector) const
 Fill the outputs for a given queue descriptor. More...
 
void SetData (std::unique_ptr< ITensorHandle > data)
 
bool IsTensorInfoSet () const
 Returns true if SetTensorInfo() has been called at least once on this. More...
 

Detailed Description

Definition at line 28 of file OutputHandler.hpp.

Member Function Documentation

◆ CollectWorkloadOutputs()

void CollectWorkloadOutputs ( WorkloadDataCollector dataCollector) const

Fill the outputs for a given queue descriptor.

Definition at line 33 of file OutputHandler.cpp.

References WorkloadDataCollector::Push().

Referenced by OutputHandler::GetData().

34 {
35  dataCollector.Push(m_TensorHandle.get(), m_TensorInfo);
36 }

◆ CreateTensorHandles() [1/2]

void CreateTensorHandles ( const IWorkloadFactory factory,
const bool  IsMemoryManaged = true 
)

  • Creates tensor handles used by the intermediate tensors.

Does not allocate memory.

Parameters
factory- Factory to be used for handler creation.

Definition at line 21 of file OutputHandler.cpp.

References ARMNN_NO_DEPRECATE_WARN_BEGIN, ARMNN_NO_DEPRECATE_WARN_END, and IWorkloadFactory::CreateTensorHandle().

Referenced by Layer::CreateTensorHandles().

22 {
24  m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
26 }
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
#define ARMNN_NO_DEPRECATE_WARN_END
Definition: Deprecated.hpp:34

◆ CreateTensorHandles() [2/2]

void CreateTensorHandles ( const ITensorHandleFactory factory,
const bool  IsMemoryManaged = true 
)

Definition at line 28 of file OutputHandler.cpp.

References ITensorHandleFactory::CreateTensorHandle().

29 {
30  m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
31 }

◆ GetData()

ITensorHandle* GetData ( ) const
inline

  • Gets the allocated tensor memory.

Returns
- Pointer to the tensor memory.

Definition at line 46 of file OutputHandler.hpp.

References OutputHandler::CollectWorkloadOutputs().

Referenced by BOOST_AUTO_TEST_CASE(), ConcatLayer::CreateWorkload(), and SplitterLayer::CreateWorkload().

46 { return m_TensorHandle.get(); }

◆ GetTensorInfo()

const TensorInfo& GetTensorInfo ( ) const
inline

Returns
- References to the output TensorInfo.

Definition at line 42 of file OutputHandler.hpp.

Referenced by ConcatLayer::CreateWorkload(), SplitterLayer::CreateWorkload(), PermuteAsReshapeImpl::Run(), TransposeAsReshapeImpl::Run(), and OptimizeConsecutiveReshapesImpl::Run().

42 { return m_TensorInfo; }

◆ IsTensorInfoSet()

bool IsTensorInfoSet ( ) const
inline

Returns true if SetTensorInfo() has been called at least once on this.

Definition at line 54 of file OutputHandler.hpp.

Referenced by InputLayer::ValidateTensorShapesFromInputs().

54 { return m_bTensorInfoSet; }

◆ SetData()

void SetData ( std::unique_ptr< ITensorHandle data)
inline

Definition at line 51 of file OutputHandler.hpp.

Referenced by ConcatLayer::CreateWorkload().

51 { m_TensorHandle = std::move(data); }

◆ SetTensorInfo()

void SetTensorInfo ( const TensorInfo tensorInfo)

  • Sets the TensorInfo used by this output handler.

Parameters
tensorInfo- TensorInfo for the output.

Definition at line 15 of file OutputHandler.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), InputSlot::Insert(), OutputSlot::MoveAllConnections(), MovePermuteUpImpl::Run(), and MoveTransposeUpImpl::Run().

16 {
17  m_TensorInfo = tensorInfo;
18  m_bTensorInfoSet = true;
19 }

The documentation for this class was generated from the following files: