ArmNN
 24.08
SampleDynamicLayerSupport Class Reference

#include <SampleDynamicLayerSupport.hpp>

Inheritance diagram for SampleDynamicLayerSupport:
[legend]
Collaboration diagram for SampleDynamicLayerSupport:
[legend]

Public Member Functions

bool IsAdditionSupported (const armnn::TensorInfo &input0, const armnn::TensorInfo &input1, const armnn::TensorInfo &output, armnn::Optional< std::string & > reasonIfUnsupported=armnn::EmptyOptional()) const
 
bool IsInputSupported (const armnn::TensorInfo &input, armnn::Optional< std::string & > reasonIfUnsupported) const
 
bool IsOutputSupported (const armnn::TensorInfo &output, armnn::Optional< std::string & > reasonIfUnsupported) const
 
bool IsLayerSupported (const armnn::LayerType &type, const std::vector< armnn::TensorInfo > &infos, const armnn::BaseDescriptor &descriptor, const armnn::Optional< armnn::LstmInputParamsInfo > &lstmParamsInfo, const armnn::Optional< armnn::QuantizedLstmInputParamsInfo > &quantizedLstmParamsInfo, armnn::Optional< std::string & > reasonIfUnsupported=armnn::EmptyOptional()) const
 Default implementation of the ILayerSupport interface, Backends should implement this as a switch statement for each of their LayerTypes calling their specific backend implementation of IsXXXLayerSupported. More...
 
- Public Member Functions inherited from LayerSupportBase
bool IsDetectionPostProcessSupported (const TensorInfo &boxEncodings, const TensorInfo &scores, const TensorInfo &anchors, const TensorInfo &detectionBoxes, const TensorInfo &detectionClasses, const TensorInfo &detectionScores, const TensorInfo &numDetections, const DetectionPostProcessDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 
bool IsMemCopySupported (const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 
bool IsMemImportSupported (const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 
bool IsMergeSupported (const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 
bool IsQuantizedLstmSupported (const TensorInfo &input, const TensorInfo &previousCellStateIn, const TensorInfo &previousOutputIn, const TensorInfo &cellStateOut, const TensorInfo &output, const QuantizedLstmInputParamsInfo &paramsInfo, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 
bool IsShapeSupported (const TensorInfo &input, const TensorInfo &output, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 
bool IsStandInSupported (const std::vector< const TensorInfo * > &inputs, const std::vector< const TensorInfo * > &outputs, const StandInDescriptor &descriptor, Optional< std::string & > reasonIfUnsupported=EmptyOptional()) const
 

Additional Inherited Members

- Protected Member Functions inherited from ILayerSupport
 ILayerSupport ()
 
virtual ~ILayerSupport ()
 

Detailed Description

Definition at line 13 of file SampleDynamicLayerSupport.hpp.

Member Function Documentation

◆ IsAdditionSupported()

bool IsAdditionSupported ( const armnn::TensorInfo input0,
const armnn::TensorInfo input1,
const armnn::TensorInfo output,
armnn::Optional< std::string & >  reasonIfUnsupported = armnn::EmptyOptional() 
) const

Definition at line 52 of file SampleDynamicLayerSupport.cpp.

56 {
57 
58  if (input0.GetDataType() != armnn::DataType::Float32)
59  {
60  return false;
61  }
62 
63  if (input0.GetDataType() != input1.GetDataType())
64  {
65  return false;
66  }
67 
68  if (input0.GetDataType() != output.GetDataType())
69  {
70  return false;
71  }
72 
73  return true;
74 }

References armnn::Float32, and TensorInfo::GetDataType().

Referenced by SampleDynamicLayerSupport::IsLayerSupported().

◆ IsInputSupported()

bool IsInputSupported ( const armnn::TensorInfo input,
armnn::Optional< std::string & >  reasonIfUnsupported 
) const

Definition at line 40 of file SampleDynamicLayerSupport.cpp.

42 {
43  return true;
44 }

Referenced by SampleDynamicLayerSupport::IsLayerSupported().

◆ IsLayerSupported()

bool IsLayerSupported ( const armnn::LayerType type,
const std::vector< armnn::TensorInfo > &  infos,
const armnn::BaseDescriptor descriptor,
const armnn::Optional< armnn::LstmInputParamsInfo > &  lstmParamsInfo,
const armnn::Optional< armnn::QuantizedLstmInputParamsInfo > &  quantizedLstmParamsInfo,
armnn::Optional< std::string & >  reasonIfUnsupported = armnn::EmptyOptional() 
) const
virtual

Default implementation of the ILayerSupport interface, Backends should implement this as a switch statement for each of their LayerTypes calling their specific backend implementation of IsXXXLayerSupported.

Reimplemented from LayerSupportBase.

Definition at line 15 of file SampleDynamicLayerSupport.cpp.

23 {
24  switch (type)
25  {
27  return IsInputSupported(infos[0], reasonIfUnsupported);
29  return IsOutputSupported(infos[0], reasonIfUnsupported);
31  return IsAdditionSupported(infos[0],
32  infos[1],
33  infos[2],
34  reasonIfUnsupported);
35  default:
36  return false;
37  }
38 }

References armnn::Addition, armnn::Input, SampleDynamicLayerSupport::IsAdditionSupported(), SampleDynamicLayerSupport::IsInputSupported(), SampleDynamicLayerSupport::IsOutputSupported(), and armnn::Output.

◆ IsOutputSupported()

bool IsOutputSupported ( const armnn::TensorInfo output,
armnn::Optional< std::string & >  reasonIfUnsupported 
) const

Definition at line 46 of file SampleDynamicLayerSupport.cpp.

48 {
49  return true;
50 }

Referenced by SampleDynamicLayerSupport::IsLayerSupported().


The documentation for this class was generated from the following files:
armnn::DataType::Float32
@ Float32
armnn::LayerType::Addition
@ Addition
armnn::TensorInfo::GetDataType
DataType GetDataType() const
Definition: Tensor.hpp:200
sdb::SampleDynamicLayerSupport::IsInputSupported
bool IsInputSupported(const armnn::TensorInfo &input, armnn::Optional< std::string & > reasonIfUnsupported) const
Definition: SampleDynamicLayerSupport.cpp:40
armnn::LayerType::Input
@ Input
sdb::SampleDynamicLayerSupport::IsAdditionSupported
bool IsAdditionSupported(const armnn::TensorInfo &input0, const armnn::TensorInfo &input1, const armnn::TensorInfo &output, armnn::Optional< std::string & > reasonIfUnsupported=armnn::EmptyOptional()) const
Definition: SampleDynamicLayerSupport.cpp:52
armnn::LayerType::Output
@ Output
sdb::SampleDynamicLayerSupport::IsOutputSupported
bool IsOutputSupported(const armnn::TensorInfo &output, armnn::Optional< std::string & > reasonIfUnsupported) const
Definition: SampleDynamicLayerSupport.cpp:46