ArmNN
 20.11
TestQuantizedLstmLayerVisitor Class Reference

#include <ConstTensorLayerVisitor.hpp>

Inheritance diagram for TestQuantizedLstmLayerVisitor:
TestLayerVisitor LayerVisitorBase< VisitorNoThrowPolicy > ILayerVisitor

Public Member Functions

 TestQuantizedLstmLayerVisitor (const QuantizedLstmInputParams &params, const char *name=nullptr)
 
void VisitQuantizedLstmLayer (const IConnectableLayer *layer, const QuantizedLstmInputParams &params, const char *name=nullptr)
 Function a QuantizedLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
- Public Member Functions inherited from TestLayerVisitor
 TestLayerVisitor (const char *name)
 
- Public Member Functions inherited from LayerVisitorBase< VisitorNoThrowPolicy >
void VisitAbsLayer (const IConnectableLayer *, const char *) override
 Function an absolute layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitActivationLayer (const IConnectableLayer *, const ActivationDescriptor &, const char *) override
 Function that an activation layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitAdditionLayer (const IConnectableLayer *, const char *) override
 Function that an addition layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitArgMinMaxLayer (const IConnectableLayer *, const ArgMinMaxDescriptor &, const char *) override
 Function that an arg min max layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitBatchNormalizationLayer (const IConnectableLayer *, const BatchNormalizationDescriptor &, const ConstTensor &, const ConstTensor &, const ConstTensor &, const ConstTensor &, const char *) override
 Function that a batch normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitBatchToSpaceNdLayer (const IConnectableLayer *, const BatchToSpaceNdDescriptor &, const char *) override
 Function that a batch to space ND layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitComparisonLayer (const IConnectableLayer *, const ComparisonDescriptor &, const char *) override
 Function a Comparison layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitConcatLayer (const IConnectableLayer *, const ConcatDescriptor &, const char *) override
 Function that a concat layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitConstantLayer (const IConnectableLayer *, const ConstTensor &, const char *) override
 Function a layer with no inputs and a single output, which always corresponds to the passed in constant tensor should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitConvolution2dLayer (const IConnectableLayer *, const Convolution2dDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
 Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitDepthToSpaceLayer (const IConnectableLayer *, const DepthToSpaceDescriptor &, const char *) override
 Function a depth to space layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitDepthwiseConvolution2dLayer (const IConnectableLayer *, const DepthwiseConvolution2dDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
 Function that a 2D depthwise convolution layer with biases should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitDequantizeLayer (const IConnectableLayer *, const char *) override
 Function that a Dequantize layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitDetectionPostProcessLayer (const IConnectableLayer *, const DetectionPostProcessDescriptor &, const ConstTensor &, const char *) override
 Function that a Detection PostProcess layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitDivisionLayer (const IConnectableLayer *, const char *) override
 Function a division layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitElementwiseUnaryLayer (const IConnectableLayer *, const ElementwiseUnaryDescriptor &, const char *) override
 Function a ElementwiseUnary layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitEqualLayer (const IConnectableLayer *, const char *) override
 Function an Equal layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitFillLayer (const IConnectableLayer *, const FillDescriptor &, const char *) override
 Function a fill layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitFloorLayer (const IConnectableLayer *, const char *) override
 Function a floor layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitFullyConnectedLayer (const IConnectableLayer *, const FullyConnectedDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
 Function that a fully connected layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitGatherLayer (const IConnectableLayer *, const char *) override
 Function a Gather layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitGatherLayer (const IConnectableLayer *, const GatherDescriptor &, const char *) override
 Function a Gather layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitGreaterLayer (const IConnectableLayer *, const char *) override
 Function a Greater layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitInputLayer (const IConnectableLayer *, LayerBindingId, const char *) override
 Function that an InputLayer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitInstanceNormalizationLayer (const IConnectableLayer *, const InstanceNormalizationDescriptor &, const char *) override
 Function that an instance normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitL2NormalizationLayer (const IConnectableLayer *, const L2NormalizationDescriptor &, const char *) override
 Function that an L2 normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitLogSoftmaxLayer (const IConnectableLayer *, const LogSoftmaxDescriptor &, const char *) override
 Function that a log softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitLogicalBinaryLayer (const IConnectableLayer *, const LogicalBinaryDescriptor &, const char *) override
 Function that a logical binary layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitLstmLayer (const IConnectableLayer *, const LstmDescriptor &, const LstmInputParams &, const char *) override
 Function an Lstm layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitMaximumLayer (const IConnectableLayer *, const char *) override
 Function a Maximum layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitMeanLayer (const IConnectableLayer *, const MeanDescriptor &, const char *) override
 Function a Mean layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitMergeLayer (const IConnectableLayer *, const char *) override
 Function that a merge layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitMergerLayer (const IConnectableLayer *, const MergerDescriptor &, const char *) override
 Function that a merger layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitMinimumLayer (const IConnectableLayer *, const char *) override
 Function a Minimum layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitMultiplicationLayer (const IConnectableLayer *, const char *) override
 Function that a multiplication layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitNormalizationLayer (const IConnectableLayer *, const NormalizationDescriptor &, const char *) override
 Function that a normalization layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitOutputLayer (const IConnectableLayer *, LayerBindingId, const char *) override
 Function an output layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitPadLayer (const IConnectableLayer *, const PadDescriptor &, const char *) override
 Function a pad layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitPermuteLayer (const IConnectableLayer *, const PermuteDescriptor &, const char *) override
 Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitPooling2dLayer (const IConnectableLayer *, const Pooling2dDescriptor &, const char *) override
 Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitPreluLayer (const IConnectableLayer *, const char *) override
 Function that a PReLU activation layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitQuantizeLayer (const IConnectableLayer *, const char *) override
 Function a quantize layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitQLstmLayer (const IConnectableLayer *, const QLstmDescriptor &, const LstmInputParams &, const char *) override
 Function a QLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitQuantizedLstmLayer (const IConnectableLayer *, const QuantizedLstmInputParams &, const char *) override
 Function a QuantizedLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitRankLayer (const IConnectableLayer *, const char *) override
 Function a rank layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitReshapeLayer (const IConnectableLayer *, const ReshapeDescriptor &, const char *) override
 Function a reshape layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitResizeBilinearLayer (const IConnectableLayer *, const ResizeBilinearDescriptor &, const char *) override
 Function that a resize bilinear layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitResizeLayer (const IConnectableLayer *, const ResizeDescriptor &, const char *) override
 Function that a resize layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitRsqrtLayer (const IConnectableLayer *, const char *) override
 Function a Reciprocal of square root layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSliceLayer (const IConnectableLayer *, const SliceDescriptor &, const char *) override
 Function that a slice layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSoftmaxLayer (const IConnectableLayer *, const SoftmaxDescriptor &, const char *) override
 Function that a softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSpaceToBatchNdLayer (const IConnectableLayer *, const SpaceToBatchNdDescriptor &, const char *) override
 Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSpaceToDepthLayer (const IConnectableLayer *, const SpaceToDepthDescriptor &, const char *) override
 Function a space to depth layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSplitterLayer (const IConnectableLayer *, const ViewsDescriptor &, const char *) override
 Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitStackLayer (const IConnectableLayer *, const StackDescriptor &, const char *) override
 Function a stack layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitStandInLayer (const IConnectableLayer *, const StandInDescriptor &, const char *) override
 Function a StandInLayer should call back to when its Accept(ILaterVisitor&) function is invoked. More...
 
void VisitStridedSliceLayer (const IConnectableLayer *, const StridedSliceDescriptor &, const char *) override
 Function a strided slice layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSubtractionLayer (const IConnectableLayer *, const char *) override
 Function a subtraction layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitSwitchLayer (const IConnectableLayer *, const char *) override
 Function a switch layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitTransposeConvolution2dLayer (const IConnectableLayer *, const TransposeConvolution2dDescriptor &, const ConstTensor &, const Optional< ConstTensor > &, const char *) override
 Function that a 2D transpose convolution layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
void VisitTransposeLayer (const IConnectableLayer *, const TransposeDescriptor &, const char *) override
 Function that a transpose layer should call back to when its Accept(ILayerVisitor&) function is invoked. More...
 
- Public Member Functions inherited from ILayerVisitor
virtual void StartVisit ()
 
virtual void FinishVisit ()
 

Protected Member Functions

void CheckInputParameters (const QuantizedLstmInputParams &inputParams)
 
void CheckConstTensorPtrs (const std::string &name, const ConstTensor *expected, const ConstTensor *actual)
 
- 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 CheckOptionalConstTensors (const Optional< ConstTensor > &expected, const Optional< ConstTensor > &actual)
 
- Protected Member Functions inherited from LayerVisitorBase< VisitorNoThrowPolicy >
 LayerVisitorBase ()
 
virtual ~LayerVisitorBase ()
 
- Protected Member Functions inherited from ILayerVisitor
 ILayerVisitor ()
 
virtual ~ILayerVisitor ()
 

Detailed Description

Definition at line 257 of file ConstTensorLayerVisitor.hpp.

Constructor & Destructor Documentation

◆ TestQuantizedLstmLayerVisitor()

TestQuantizedLstmLayerVisitor ( const QuantizedLstmInputParams params,
const char *  name = nullptr 
)
inlineexplicit

Definition at line 260 of file ConstTensorLayerVisitor.hpp.

262  : TestLayerVisitor(name)
263  , m_InputParams(params)
264  {}
TestLayerVisitor(const char *name)

Member Function Documentation

◆ CheckConstTensorPtrs()

void CheckConstTensorPtrs ( const std::string &  name,
const ConstTensor expected,
const ConstTensor actual 
)
protected

Definition at line 208 of file ConstTensorLayerVisitor.cpp.

References TestLayerVisitor::CheckConstTensors().

211 {
212  if (expected == nullptr)
213  {
214  BOOST_CHECK_MESSAGE(actual == nullptr, name + " actual should have been a nullptr");
215  }
216  else
217  {
218  BOOST_CHECK_MESSAGE(actual != nullptr, name + " actual should have been set");
219  if (actual != nullptr)
220  {
221  CheckConstTensors(*expected, *actual);
222  }
223  }
224 }
void CheckConstTensors(const ConstTensor &expected, const ConstTensor &actual)

◆ CheckInputParameters()

void CheckInputParameters ( const QuantizedLstmInputParams inputParams)
protected

Definition at line 226 of file ConstTensorLayerVisitor.cpp.

References BOOST_AUTO_TEST_SUITE(), QuantizedLstmInputParams::m_CellBias, QuantizedLstmInputParams::m_ForgetGateBias, QuantizedLstmInputParams::m_InputGateBias, QuantizedLstmInputParams::m_InputToCellWeights, QuantizedLstmInputParams::m_InputToForgetWeights, QuantizedLstmInputParams::m_InputToInputWeights, QuantizedLstmInputParams::m_InputToOutputWeights, QuantizedLstmInputParams::m_OutputGateBias, QuantizedLstmInputParams::m_RecurrentToCellWeights, QuantizedLstmInputParams::m_RecurrentToForgetWeights, QuantizedLstmInputParams::m_RecurrentToInputWeights, and QuantizedLstmInputParams::m_RecurrentToOutputWeights.

227 {
228  CheckConstTensorPtrs("InputToInputWeights",
229  m_InputParams.m_InputToInputWeights,
230  inputParams.m_InputToInputWeights);
231 
232  CheckConstTensorPtrs("InputToForgetWeights",
233  m_InputParams.m_InputToForgetWeights,
234  inputParams.m_InputToForgetWeights);
235 
236  CheckConstTensorPtrs("InputToCellWeights",
237  m_InputParams.m_InputToCellWeights,
238  inputParams.m_InputToCellWeights);
239 
240  CheckConstTensorPtrs("InputToOutputWeights",
241  m_InputParams.m_InputToOutputWeights,
242  inputParams.m_InputToOutputWeights);
243 
244  CheckConstTensorPtrs("RecurrentToInputWeights",
245  m_InputParams.m_RecurrentToInputWeights,
246  inputParams.m_RecurrentToInputWeights);
247 
248  CheckConstTensorPtrs("RecurrentToForgetWeights",
249  m_InputParams.m_RecurrentToForgetWeights,
250  inputParams.m_RecurrentToForgetWeights);
251 
252  CheckConstTensorPtrs("RecurrentToCellWeights",
253  m_InputParams.m_RecurrentToCellWeights,
254  inputParams.m_RecurrentToCellWeights);
255 
256  CheckConstTensorPtrs("RecurrentToOutputWeights",
257  m_InputParams.m_RecurrentToOutputWeights,
258  inputParams.m_RecurrentToOutputWeights);
259 
260  CheckConstTensorPtrs("InputGateBias", m_InputParams.m_InputGateBias, inputParams.m_InputGateBias);
261  CheckConstTensorPtrs("ForgetGateBias", m_InputParams.m_ForgetGateBias, inputParams.m_ForgetGateBias);
262  CheckConstTensorPtrs("CellBias", m_InputParams.m_CellBias, inputParams.m_CellBias);
263  CheckConstTensorPtrs("OutputGateBias", m_InputParams.m_OutputGateBias, inputParams.m_OutputGateBias);
264 }
const ConstTensor * m_RecurrentToOutputWeights
const ConstTensor * m_RecurrentToForgetWeights
const ConstTensor * m_InputToForgetWeights
const ConstTensor * m_RecurrentToInputWeights
const ConstTensor * m_RecurrentToCellWeights
const ConstTensor * m_InputToOutputWeights
void CheckConstTensorPtrs(const std::string &name, const ConstTensor *expected, const ConstTensor *actual)

◆ VisitQuantizedLstmLayer()

void VisitQuantizedLstmLayer ( const IConnectableLayer layer,
const QuantizedLstmInputParams params,
const char *  name = nullptr 
)
inlinevirtual

Function a QuantizedLstm layer should call back to when its Accept(ILayerVisitor&) function is invoked.

Parameters
layer- pointer to the layer which is calling back to this visit function.
params- The weights and biases for the Quantized LSTM cell
name- Optional name for the layer.

Implements ILayerVisitor.

Definition at line 266 of file ConstTensorLayerVisitor.hpp.

References TestLayerVisitor::CheckLayerName(), and TestLayerVisitor::CheckLayerPointer().

269  {
270  CheckLayerPointer(layer);
271  CheckLayerName(name);
272  CheckInputParameters(params);
273  }
void CheckLayerName(const char *name)
void CheckLayerPointer(const IConnectableLayer *layer)
void CheckInputParameters(const QuantizedLstmInputParams &inputParams)

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