ArmNN
 24.02
LayerInputHandle Class Reference

#include <ConversionUtils.hpp>

Public Member Functions

 LayerInputHandle ()
 
 LayerInputHandle (bool valid, armnn::IOutputSlot *outputSlot, armnn::TensorInfo tensorInfo)
 
bool IsValid () const
 
void Connect (armnn::IInputSlot &inputSlot)
 
void Disconnect (armnn::IInputSlot &inputSlot)
 
const armnn::TensorInfoGetTensorInfo () const
 
void SanitizeQuantizationScale (LayerInputHandle &weight, LayerInputHandle &input)
 
armnn::IOutputSlotGetOutputSlot () const
 

Detailed Description

Definition at line 68 of file ConversionUtils.hpp.

Constructor & Destructor Documentation

◆ LayerInputHandle() [1/2]

Definition at line 17 of file ConversionUtils.cpp.

18  : m_OutputSlot(nullptr)
19  , m_Valid(false)
20 {}

◆ LayerInputHandle() [2/2]

LayerInputHandle ( bool  valid,
armnn::IOutputSlot outputSlot,
armnn::TensorInfo  tensorInfo 
)

Definition at line 22 of file ConversionUtils.cpp.

23  : m_OutputSlot(outputSlot)
24  , m_Valid(valid)
25  , m_TensorInfo(tensorInfo)
26 {}

Member Function Documentation

◆ Connect()

void Connect ( armnn::IInputSlot inputSlot)

Definition at line 33 of file ConversionUtils.cpp.

34 {
35  if (!IsValid())
36  {
37  throw armnn::Exception("cannot invoke Connect on an invalid LayerInputHandle");
38  }
39  if (m_OutputSlot)
40  {
41  m_OutputSlot->Connect(inputSlot);
42  }
43 }

References IOutputSlot::Connect(), and LayerInputHandle::IsValid().

Referenced by armnn_driver::ConvertPooling2d(), armnn_driver::ConvertReduce(), and armnn_driver::ConvertToActivation().

◆ Disconnect()

void Disconnect ( armnn::IInputSlot inputSlot)

Definition at line 45 of file ConversionUtils.cpp.

46 {
47  if (!IsValid())
48  {
49  throw armnn::Exception("cannot invoke Disconnect on an invalid LayerInputHandle");
50  }
51  if (m_OutputSlot)
52  {
53  m_OutputSlot->Disconnect(inputSlot);
54  }
55 }

References IOutputSlot::Disconnect(), and LayerInputHandle::IsValid().

◆ GetOutputSlot()

armnn::IOutputSlot * GetOutputSlot ( ) const

Definition at line 77 of file ConversionUtils.cpp.

78 {
79  return m_OutputSlot;
80 }

◆ GetTensorInfo()

const armnn::TensorInfo & GetTensorInfo ( ) const

◆ IsValid()

◆ SanitizeQuantizationScale()

void SanitizeQuantizationScale ( LayerInputHandle weight,
LayerInputHandle input 
)

Definition at line 62 of file ConversionUtils.cpp.

63 {
64  if (m_OutputSlot)
65  {
66  armnn::TensorInfo weightInfo = weight.GetTensorInfo();
67  armnn::TensorInfo inputInfo = input.GetTensorInfo();
68  armnn::TensorInfo biasInfo = GetTensorInfo();
69 
70  SanitizeBiasQuantizationScale(biasInfo, weightInfo, inputInfo);
71 
72  m_TensorInfo = biasInfo;
73  m_OutputSlot->SetTensorInfo(biasInfo);
74  }
75 }

References LayerInputHandle::GetTensorInfo(), and IOutputSlot::SetTensorInfo().


The documentation for this class was generated from the following files:
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::IOutputSlot::Disconnect
virtual void Disconnect(IInputSlot &slot)=0
armnn::IOutputSlot::SetTensorInfo
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
armnn::Exception
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
armnn::IOutputSlot::Connect
virtual int Connect(IInputSlot &destination)=0
armnn_driver::LayerInputHandle::GetTensorInfo
const armnn::TensorInfo & GetTensorInfo() const
Definition: ConversionUtils.cpp:57
armnn_driver::LayerInputHandle::IsValid
bool IsValid() const
Definition: ConversionUtils.cpp:28