ArmNN
 22.08
TestLstmLayerVisitor Class Reference

#include <ConstTensorLayerVisitor.hpp>

Inheritance diagram for TestLstmLayerVisitor:
LstmVisitor TestLayerVisitor StrategyBase< NoThrowStrategy > IStrategy

Public Member Functions

 TestLstmLayerVisitor (const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr)
 
void ExecuteStrategy (const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0) override
 
- Public Member Functions inherited from LstmVisitor
 LstmVisitor (const LstmInputParams &params, const char *name=nullptr)
 
- Public Member Functions inherited from TestLayerVisitor
 TestLayerVisitor (const char *name)
 
- Public Member Functions inherited from IStrategy
virtual void FinishStrategy ()
 

Protected Member Functions

void CheckDescriptor (const LstmDescriptor &descriptor)
 
- Protected Member Functions inherited from LstmVisitor
template<typename LayerType >
void CheckInputParameters (const LayerType *layer, const LstmInputParams &inputParams)
 
- Protected Member Functions inherited from TestLayerVisitor
virtual ~TestLayerVisitor ()
 
void CheckLayerName (const char *name)
 
void CheckLayerPointer (const IConnectableLayer *layer)
 
void CheckConstTensors (const ConstTensor &expected, const ConstTensor &actual)
 
void CheckConstTensors (const ConstTensor &expected, const ConstTensorHandle &actual)
 
void CheckConstTensorPtrs (const std::string &name, const ConstTensor *expected, const ConstTensor *actual)
 
void CheckConstTensorPtrs (const std::string &name, const ConstTensor *expected, const std::shared_ptr< ConstTensorHandle > actual)
 
void CheckOptionalConstTensors (const Optional< ConstTensor > &expected, const Optional< ConstTensor > &actual)
 
- Protected Member Functions inherited from StrategyBase< NoThrowStrategy >
virtual ~StrategyBase ()
 
- Protected Member Functions inherited from IStrategy
 IStrategy ()
 
virtual ~IStrategy ()
 

Additional Inherited Members

- Protected Attributes inherited from LstmVisitor
LstmInputParams m_InputParams
 
- Protected Attributes inherited from StrategyBase< NoThrowStrategy >
NoThrowStrategy m_DefaultStrategy
 

Detailed Description

Definition at line 321 of file ConstTensorLayerVisitor.hpp.

Constructor & Destructor Documentation

◆ TestLstmLayerVisitor()

TestLstmLayerVisitor ( const LstmDescriptor descriptor,
const LstmInputParams params,
const char *  name = nullptr 
)
inlineexplicit

Definition at line 324 of file ConstTensorLayerVisitor.hpp.

327  : LstmVisitor(params, name)
328  , m_Descriptor(descriptor)
329  {}
LstmVisitor(const LstmInputParams &params, const char *name=nullptr)

Member Function Documentation

◆ CheckDescriptor()

void CheckDescriptor ( const LstmDescriptor descriptor)
protected

Definition at line 51 of file ConstTensorLayerVisitor.cpp.

References LstmDescriptor::m_ActivationFunc, LstmDescriptor::m_CifgEnabled, LstmDescriptor::m_ClippingThresCell, LstmDescriptor::m_ClippingThresProj, LstmDescriptor::m_PeepholeEnabled, and LstmDescriptor::m_ProjectionEnabled.

52 {
53  CHECK(m_Descriptor.m_ActivationFunc == descriptor.m_ActivationFunc);
54  CHECK(m_Descriptor.m_ClippingThresCell == descriptor.m_ClippingThresCell);
55  CHECK(m_Descriptor.m_ClippingThresProj == descriptor.m_ClippingThresProj);
56  CHECK(m_Descriptor.m_CifgEnabled == descriptor.m_CifgEnabled);
57  CHECK(m_Descriptor.m_PeepholeEnabled == descriptor.m_PeepholeEnabled);
58  CHECK(m_Descriptor.m_ProjectionEnabled == descriptor.m_ProjectionEnabled);
59 }
bool m_ProjectionEnabled
Enable/disable the projection layer.
float m_ClippingThresProj
Clipping threshold value for the projection.
bool m_PeepholeEnabled
Enable/disable peephole.
uint32_t m_ActivationFunc
The activation function to use.
float m_ClippingThresCell
Clipping threshold value for the cell state.
bool m_CifgEnabled
Enable/disable cifg (coupled input & forget gate).

◆ ExecuteStrategy()

void ExecuteStrategy ( const armnn::IConnectableLayer layer,
const armnn::BaseDescriptor descriptor,
const std::vector< armnn::ConstTensor > &  constants,
const char *  name,
const armnn::LayerBindingId  id = 0 
)
inlineoverridevirtual

Reimplemented from StrategyBase< NoThrowStrategy >.

Definition at line 331 of file ConstTensorLayerVisitor.hpp.

References NoThrowStrategy::Apply(), TestConvolution2dLayerVisitor::CheckDescriptor(), TestLayerVisitor::CheckLayerName(), TestLayerVisitor::CheckLayerPointer(), armnn::GetLayerTypeAsCString(), IConnectableLayer::GetType(), armnn::IgnoreUnused(), armnn::Lstm, and StrategyBase< NoThrowStrategy >::m_DefaultStrategy.

336  {
337  armnn::IgnoreUnused(descriptor, constants, id);
338  switch (layer->GetType())
339  {
341  {
342  CheckLayerPointer(layer);
343  CheckLayerName(name);
344  CheckDescriptor(static_cast<const armnn::LstmDescriptor&>(descriptor));
345  CheckInputParameters<const LstmLayer>(PolymorphicDowncast<const LstmLayer*>(layer), m_InputParams);
346  break;
347  }
348  default:
349  {
351  }
352  }
353  }
void CheckLayerName(const char *name)
void CheckLayerPointer(const IConnectableLayer *layer)
void IgnoreUnused(Ts &&...)
void CheckDescriptor(const LstmDescriptor &descriptor)
void Apply(const std::string &)
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
const char * GetLayerTypeAsCString(LayerType type)

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