ArmNN  NotReleased
Network Class Referencefinal

Private implementation of INetwork. More...

#include <Network.hpp>

Inheritance diagram for Network:
INetwork

Public Member Functions

 Network ()
 
 ~Network ()
 
const GraphGetGraph () const
 
Status PrintGraph () override
 
profiling::ProfilingGuid GetGuid () const final
 
IConnectableLayerAddInputLayer (LayerBindingId id, const char *name=nullptr) override
 
IConnectableLayerAddArgMinMaxLayer (const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
 
IConnectableLayerAddBatchToSpaceNdLayer (const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddComparisonLayer (const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddConcatLayer (const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddConvolution2dLayer (const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 
IConnectableLayerAddConvolution2dLayer (const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const char *name=nullptr) override
 
IConnectableLayerAddConvolution2dLayer (const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const ConstTensor &biases, const char *name=nullptr) override
 
IConnectableLayerAddDepthToSpaceLayer (const DepthToSpaceDescriptor &depthToSpaceDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddDepthwiseConvolution2dLayer (const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 
IConnectableLayerAddDepthwiseConvolution2dLayer (const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const char *name=nullptr) override
 
IConnectableLayerAddDepthwiseConvolution2dLayer (const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const ConstTensor &biases, const char *name=nullptr) override
 
IConnectableLayerAddDequantizeLayer (const char *name=nullptr) override
 
IConnectableLayerAddDetectionPostProcessLayer (const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr) override
 
IConnectableLayerAddElementwiseUnaryLayer (const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddFullyConnectedLayer (const FullyConnectedDescriptor &fullyConnectedDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 
IConnectableLayerAddFullyConnectedLayer (const FullyConnectedDescriptor &fullyConnectedDescriptor, const ConstTensor &weights, const char *name=nullptr) override
 
IConnectableLayerAddFullyConnectedLayer (const FullyConnectedDescriptor &fullyConnectedDescriptor, const ConstTensor &weights, const ConstTensor &biases, const char *name=nullptr) override
 
IConnectableLayerAddGatherLayer (const char *name=nullptr) override
 
IConnectableLayerAddPermuteLayer (const PermuteDescriptor &permuteDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddPooling2dLayer (const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddActivationLayer (const ActivationDescriptor &activationDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddNormalizationLayer (const NormalizationDescriptor &normalizationDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddSliceLayer (const SliceDescriptor &sliceDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddSoftmaxLayer (const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddSplitterLayer (const ViewsDescriptor &splitterDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddMergerLayer (const MergerDescriptor &mergerDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddAbsLayer (const char *name=nullptr) override
 
IConnectableLayerAddAdditionLayer (const char *name=nullptr) override
 
IConnectableLayerAddMultiplicationLayer (const char *name=nullptr) override
 
IConnectableLayerAddBatchNormalizationLayer (const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr) override
 
IConnectableLayerAddResizeBilinearLayer (const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
 
IConnectableLayerAddResizeLayer (const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddInstanceNormalizationLayer (const InstanceNormalizationDescriptor &desc, const char *name=nullptr) override
 
IConnectableLayerAddL2NormalizationLayer (const L2NormalizationDescriptor &desc, const char *name=nullptr) override
 
IConnectableLayerAddLogSoftmaxLayer (const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddConstantLayer (const ConstTensor &input, const char *name=nullptr) override
 
IConnectableLayerAddReshapeLayer (const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddSpaceToBatchNdLayer (const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddSpaceToDepthLayer (const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddFloorLayer (const char *name=nullptr) override
 
IConnectableLayerAddOutputLayer (LayerBindingId id, const char *name=nullptr) override
 
IConnectableLayerAddLstmLayer (const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
 
IConnectableLayerAddDivisionLayer (const char *name=nullptr) override
 
IConnectableLayerAddSubtractionLayer (const char *name=nullptr) override
 
IConnectableLayerAddMaximumLayer (const char *name=nullptr) override
 
IConnectableLayerAddMeanLayer (const MeanDescriptor &meanDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddPadLayer (const PadDescriptor &padDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddQuantizeLayer (const char *name=nullptr) override
 
IConnectableLayerAddStridedSliceLayer (const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddMinimumLayer (const char *name=nullptr) override
 
IConnectableLayerAddGreaterLayer (const char *name=nullptr) override
 
IConnectableLayerAddEqualLayer (const char *name=nullptr) override
 
IConnectableLayerAddRsqrtLayer (const char *name=nullptr) override
 
IConnectableLayerAddMergeLayer (const char *name=nullptr) override
 
IConnectableLayerAddSwitchLayer (const char *name=nullptr) override
 
IConnectableLayerAddPreluLayer (const char *name=nullptr) override
 
IConnectableLayerAddTransposeConvolution2dLayer (const TransposeConvolution2dDescriptor &descriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 
IConnectableLayerAddStackLayer (const StackDescriptor &stackDescriptor, const char *name=nullptr) override
 
IConnectableLayerAddStandInLayer (const StandInDescriptor &descriptor, const char *name=nullptr) override
 
IConnectableLayerAddQuantizedLstmLayer (const QuantizedLstmInputParams &params, const char *name=nullptr) override
 
void Accept (ILayerVisitor &visitor) const override
 

Additional Inherited Members

- Static Public Member Functions inherited from INetwork
static INetworkCreateRaw ()
 
static INetworkPtr Create ()
 
static void Destroy (INetwork *network)
 
- Protected Member Functions inherited from INetwork
 ~INetwork ()
 

Detailed Description

Private implementation of INetwork.

Definition at line 27 of file Network.hpp.

Constructor & Destructor Documentation

◆ Network()

Network ( )

Definition at line 937 of file Network.cpp.

938 : m_Graph(std::make_unique<Graph>()),
939  m_Guid(profiling::ProfilingService::Instance().NextGuid())
940 {
941 }
static ProfilingService & Instance()

◆ ~Network()

~Network ( )

Definition at line 943 of file Network.cpp.

944 {
945 }

Member Function Documentation

◆ Accept()

void Accept ( ILayerVisitor visitor) const
overridevirtual

Implements INetwork.

Definition at line 1580 of file Network.cpp.

References Network::GetGraph().

Referenced by Network::GetGuid().

1581 {
1582  for (auto layer : GetGraph())
1583  {
1584  layer->Accept(visitor);
1585  };
1586 }
const Graph & GetGraph() const
Definition: Network.hpp:33

◆ AddAbsLayer()

IConnectableLayer * AddAbsLayer ( const char *  name = nullptr)
overridevirtual

Add absolute layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1207 of file Network.cpp.

References armnn::Abs, and Network::AddElementwiseUnaryLayer().

Referenced by Network::GetGuid().

1208 {
1209  return AddElementwiseUnaryLayer(ElementwiseUnaryDescriptor(UnaryOperation::Abs), name);
1210 }
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
Definition: Network.cpp:970

◆ AddActivationLayer()

IConnectableLayer * AddActivationLayer ( const ActivationDescriptor activationDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds an activation layer to the network.

Parameters
activationDescriptor- ActivationDescriptor to configure the activation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1155 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1157 {
1158  return m_Graph->AddLayer<ActivationLayer>(activationDescriptor, name);
1159 }

◆ AddAdditionLayer()

IConnectableLayer * AddAdditionLayer ( const char *  name = nullptr)
overridevirtual

Adds an addition layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1212 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1213 {
1214  return m_Graph->AddLayer<AdditionLayer>(name);
1215 }

◆ AddArgMinMaxLayer()

IConnectableLayer * AddArgMinMaxLayer ( const ArgMinMaxDescriptor desc,
const char *  name = nullptr 
)
overridevirtual

Adds an ArgMinMax layer to the network.

Parameters
desc- Parameters for the L2 normalization operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1161 of file Network.cpp.

Referenced by Network::GetGuid().

1163 {
1164  return m_Graph->AddLayer<ArgMinMaxLayer>(argMinMaxDescriptor, name);
1165 }

◆ AddBatchNormalizationLayer()

IConnectableLayer * AddBatchNormalizationLayer ( const BatchNormalizationDescriptor desc,
const ConstTensor mean,
const ConstTensor variance,
const ConstTensor beta,
const ConstTensor gamma,
const char *  name = nullptr 
)
overridevirtual

Adds a batch normalization layer to the network.

Parameters
mean- Pre-calculated mean for each channel.
variance- Pre-calculated variance for each channel.
beta- Per-channel additive factor.
gamma- Per-channel multiplicative factor.
Returns
- Interface for configuring the layer.
Parameters
name- Optional name for the layer.

Implements INetwork.

Definition at line 1227 of file Network.cpp.

References BatchNormalizationLayer::m_Mean.

Referenced by BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1233 {
1234  const auto layer = m_Graph->AddLayer<BatchNormalizationLayer>(desc, name);
1235 
1236  layer->m_Mean = std::make_unique<ScopedCpuTensorHandle>(mean);
1237  layer->m_Variance = std::make_unique<ScopedCpuTensorHandle>(variance);
1238  layer->m_Beta = std::make_unique<ScopedCpuTensorHandle>(beta);
1239  layer->m_Gamma = std::make_unique<ScopedCpuTensorHandle>(gamma);
1240 
1241  return layer;
1242 }

◆ AddBatchToSpaceNdLayer()

IConnectableLayer * AddBatchToSpaceNdLayer ( const BatchToSpaceNdDescriptor batchToSpaceNdDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a batch to space ND layer to the network.

Parameters
batchToSpaceNdDescriptor- Description of the layer.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 958 of file Network.cpp.

Referenced by Network::GetGuid().

960 {
961  return m_Graph->AddLayer<BatchToSpaceNdLayer>(batchToSpaceNdDescriptor, name);
962 }

◆ AddComparisonLayer()

IConnectableLayer * AddComparisonLayer ( const ComparisonDescriptor comparisonDescriptor,
const char *  name = nullptr 
)
overridevirtual

Add a Comparison layer to the network.

Parameters
name- Optional name for the layer.
desc- Descriptor for the comparison operation. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 964 of file Network.cpp.

Referenced by Network::AddEqualLayer(), Network::AddGreaterLayer(), and Network::GetGuid().

966 {
967  return m_Graph->AddLayer<ComparisonLayer>(comparisonDescriptor, name);
968 }

◆ AddConcatLayer()

IConnectableLayer * AddConcatLayer ( const ConcatDescriptor concatDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a concatenation layer to the network.

Parameters
concatDescriptor- ConcatDescriptor (synonym for OriginsDescriptor) to configure the concatenation process. Number of Views must be equal to the number of inputs, and their order must match - e.g. first view corresponds to the first input, second view to the second input, etc....
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1023 of file Network.cpp.

References OptionalBase::has_value(), Convolution2dDescriptor::m_BiasEnabled, Convolution2dLayer::m_Weight, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().

Referenced by Network::AddMergerLayer(), BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1025 {
1026  return m_Graph->AddLayer<ConcatLayer>(concatDescriptor, name);
1027 }

◆ AddConstantLayer()

IConnectableLayer * AddConstantLayer ( const ConstTensor input,
const char *  name = nullptr 
)
overridevirtual

Adds a layer with no inputs and a single output, which always corresponds to the passed in constant tensor.

Parameters
input- Tensor to be provided as the only output of the layer. The layer will maintain its own copy of the tensor data, meaning the memory referenced by input can be freed or reused after this function is called.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1280 of file Network.cpp.

References ConstantLayer::m_LayerOutput.

Referenced by armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1281 {
1282  auto layer = m_Graph->AddLayer<ConstantLayer>(name);
1283 
1284  layer->m_LayerOutput = std::make_unique<ScopedCpuTensorHandle>(input);
1285 
1286  return layer;
1287 }

◆ AddConvolution2dLayer() [1/3]

IConnectableLayer * AddConvolution2dLayer ( const Convolution2dDescriptor convolution2dDescriptor,
const ConstTensor weights,
const Optional< ConstTensor > &  biases,
const char *  name = nullptr 
)
overridevirtual

Adds a 2D convolution layer to the network.

Parameters
convolution2dDescriptor- Description of the 2D convolution layer.
weights- Tensor for the weights data.
biases- Optional tensor for the bias data. If specified, must match the output tensor shape.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1051 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1055 {
1056  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1057 }

◆ AddConvolution2dLayer() [2/3]

IConnectableLayer * AddConvolution2dLayer ( const Convolution2dDescriptor convolution2dDescriptor,
const ConstTensor weights,
const char *  name = nullptr 
)
overridevirtual

Implements INetwork.

Definition at line 1059 of file Network.cpp.

1062 {
1063  Optional<ConstTensor> biases;
1064  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1065 }

◆ AddConvolution2dLayer() [3/3]

IConnectableLayer * AddConvolution2dLayer ( const Convolution2dDescriptor convolution2dDescriptor,
const ConstTensor weights,
const ConstTensor biases,
const char *  name = nullptr 
)
overridevirtual

Implements INetwork.

Definition at line 1067 of file Network.cpp.

References OptionalBase::has_value(), DepthwiseConvolution2dDescriptor::m_BiasEnabled, DepthwiseConvolution2dLayer::m_Weight, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().

1071 {
1072  Optional<ConstTensor> optionalBiases(biases);
1073  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name);
1074 }

◆ AddDepthToSpaceLayer()

IConnectableLayer * AddDepthToSpaceLayer ( const DepthToSpaceDescriptor depthToSpaceDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a depth to space layer to the network.

Parameters
depthToSpaceDescriptor- Parameters for the depth to space operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1099 of file Network.cpp.

Referenced by Network::GetGuid().

1101 {
1102  return m_Graph->AddLayer<DepthToSpaceLayer>(depthToSpaceDescriptor, name);
1103 }

◆ AddDepthwiseConvolution2dLayer() [1/3]

IConnectableLayer * AddDepthwiseConvolution2dLayer ( const DepthwiseConvolution2dDescriptor convolution2dDescriptor,
const ConstTensor weights,
const Optional< ConstTensor > &  biases,
const char *  name = nullptr 
)
overridevirtual

Adds a 2D depthwise convolution layer to the network.

Parameters
convolution2dDescriptor- Description of the 2D depthwise convolution layer.
weights- Tensor for the weights. Expected format: [channelMultiplier, inputChannels, height, width].
biasesOptional tensor for the bias data. If specified, must match the output tensor shape.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1105 of file Network.cpp.

Referenced by armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1110 {
1111  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1112 }

◆ AddDepthwiseConvolution2dLayer() [2/3]

IConnectableLayer * AddDepthwiseConvolution2dLayer ( const DepthwiseConvolution2dDescriptor convolution2dDescriptor,
const ConstTensor weights,
const char *  name = nullptr 
)
overridevirtual

Implements INetwork.

Definition at line 1114 of file Network.cpp.

1118 {
1119  Optional<ConstTensor> biases;
1120  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1121 }

◆ AddDepthwiseConvolution2dLayer() [3/3]

IConnectableLayer * AddDepthwiseConvolution2dLayer ( const DepthwiseConvolution2dDescriptor convolution2dDescriptor,
const ConstTensor weights,
const ConstTensor biases,
const char *  name = nullptr 
)
overridevirtual

Implements INetwork.

Definition at line 1123 of file Network.cpp.

1128 {
1129  Optional<ConstTensor> optionalBiases(biases);
1130  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name);
1131 }

◆ AddDequantizeLayer()

IConnectableLayer * AddDequantizeLayer ( const char *  name = nullptr)
overridevirtual

Adds a Dequantize layer to the network.

Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1461 of file Network.cpp.

Referenced by Network::GetGuid().

1462 {
1463  return m_Graph->AddLayer<DequantizeLayer>(name);
1464 }

◆ AddDetectionPostProcessLayer()

IConnectableLayer * AddDetectionPostProcessLayer ( const DetectionPostProcessDescriptor descriptor,
const ConstTensor anchors,
const char *  name = nullptr 
)
overridevirtual

Adds a Detection PostProcess layer to the network.

Parameters
descriptor- Description of the Detection PostProcess layer.
anchors- Tensor for anchors.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1133 of file Network.cpp.

References anchors(), and DetectionPostProcessLayer::m_Anchors.

Referenced by Network::GetGuid().

1135 {
1136  const auto layer = m_Graph->AddLayer<DetectionPostProcessLayer>(descriptor, name);
1137 
1138  layer->m_Anchors = std::make_unique<ScopedCpuTensorHandle>(anchors);
1139 
1140  return layer;
1141 }
std::vector< float > anchors({ 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 10.5f, 1.0f, 1.0f, 0.5f, 10.5f, 1.0f, 1.0f, 0.5f, 100.5f, 1.0f, 1.0f })

◆ AddDivisionLayer()

IConnectableLayer * AddDivisionLayer ( const char *  name = nullptr)
overridevirtual

Adds a division layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1436 of file Network.cpp.

Referenced by Network::GetGuid().

1437 {
1438  return m_Graph->AddLayer<DivisionLayer>(name);
1439 }

◆ AddElementwiseUnaryLayer()

IConnectableLayer * AddElementwiseUnaryLayer ( const ElementwiseUnaryDescriptor elementwiseUnaryDescriptor,
const char *  name = nullptr 
)
overridevirtual

Add an ElementwiseUnary layer to the network.

Parameters
name- Optional name for the layer.
desc- Descriptor for the elementwiseUnary operation. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 970 of file Network.cpp.

References OptionalBase::has_value(), FullyConnectedDescriptor::m_BiasEnabled, FullyConnectedLayer::m_Weight, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().

Referenced by Network::AddAbsLayer(), Network::AddRsqrtLayer(), and Network::GetGuid().

972 {
973  return m_Graph->AddLayer<ElementwiseUnaryLayer>(elementwiseUnaryDescriptor, name);
974 }

◆ AddEqualLayer()

IConnectableLayer * AddEqualLayer ( const char *  name = nullptr)
overridevirtual

Add a Equal layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1477 of file Network.cpp.

References Network::AddComparisonLayer(), and armnn::Equal.

Referenced by Network::GetGuid().

1478 {
1479  return AddComparisonLayer(ComparisonDescriptor(ComparisonOperation::Equal), name);
1480 }
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Definition: Network.cpp:964

◆ AddFloorLayer()

IConnectableLayer * AddFloorLayer ( const char *  name = nullptr)
overridevirtual

Adds a floor layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1307 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1308 {
1309  return m_Graph->AddLayer<FloorLayer>(name);
1310 }

◆ AddFullyConnectedLayer() [1/3]

IConnectableLayer * AddFullyConnectedLayer ( const FullyConnectedDescriptor fullyConnectedDescriptor,
const ConstTensor weights,
const Optional< ConstTensor > &  biases,
const char *  name = nullptr 
)
overridevirtual

Adds a fully connected layer to the network.

Parameters
fullyConnectedDescriptor- Description of the fully connected layer.
weights- Tensor for the weights data.
biases- Optional tensor for the bias data.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 998 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1002 {
1003  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, biases, name);
1004 }

◆ AddFullyConnectedLayer() [2/3]

IConnectableLayer * AddFullyConnectedLayer ( const FullyConnectedDescriptor fullyConnectedDescriptor,
const ConstTensor weights,
const char *  name = nullptr 
)
overridevirtual

Implements INetwork.

Definition at line 1006 of file Network.cpp.

1009 {
1010  Optional<ConstTensor> biases;
1011  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, biases, name);
1012 }

◆ AddFullyConnectedLayer() [3/3]

IConnectableLayer * AddFullyConnectedLayer ( const FullyConnectedDescriptor fullyConnectedDescriptor,
const ConstTensor weights,
const ConstTensor biases,
const char *  name = nullptr 
)
overridevirtual

Implements INetwork.

Definition at line 1014 of file Network.cpp.

1018 {
1019  Optional<ConstTensor> optionalBiases(biases);
1020  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, optionalBiases, name);
1021 }

◆ AddGatherLayer()

IConnectableLayer * AddGatherLayer ( const char *  name = nullptr)
overridevirtual

Add Gather layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1487 of file Network.cpp.

Referenced by Network::GetGuid().

1488 {
1489  return m_Graph->AddLayer<GatherLayer>(name);
1490 }

◆ AddGreaterLayer()

IConnectableLayer * AddGreaterLayer ( const char *  name = nullptr)
overridevirtual

Add a Greater layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1472 of file Network.cpp.

References Network::AddComparisonLayer(), and armnn::Greater.

Referenced by Network::GetGuid().

1473 {
1474  return AddComparisonLayer(ComparisonDescriptor(ComparisonOperation::Greater), name);
1475 }
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Definition: Network.cpp:964

◆ AddInputLayer()

IConnectableLayer * AddInputLayer ( LayerBindingId  id,
const char *  name = nullptr 
)
overridevirtual

Adds an input layer to the network.

Parameters
id- User generated id to uniquely identify a particular input. The same id needs to be specified. when passing the inputs to the IRuntime::EnqueueWorkload() function.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 953 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

954 {
955  return m_Graph->AddLayer<InputLayer>(id, name);
956 }

◆ AddInstanceNormalizationLayer()

IConnectableLayer * AddInstanceNormalizationLayer ( const InstanceNormalizationDescriptor desc,
const char *  name = nullptr 
)
overridevirtual

Adds an instance normalization layer to the network.

Parameters
desc- Parameters for the instance normalization operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1262 of file Network.cpp.

Referenced by Network::GetGuid().

1264 {
1265  return m_Graph->AddLayer<InstanceNormalizationLayer>(desc, name);
1266 }

◆ AddL2NormalizationLayer()

IConnectableLayer * AddL2NormalizationLayer ( const L2NormalizationDescriptor desc,
const char *  name = nullptr 
)
overridevirtual

Adds an L2 normalization layer to the network. Normalization is performed along dimension 1, but requires a 4d input.

Parameters
desc- Parameters for the L2 normalization operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1268 of file Network.cpp.

Referenced by Network::GetGuid().

1270 {
1271  return m_Graph->AddLayer<L2NormalizationLayer>(desc, name);
1272 }

◆ AddLogSoftmaxLayer()

IConnectableLayer * AddLogSoftmaxLayer ( const LogSoftmaxDescriptor logSoftmaxDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a log softmax layer to the network.

Parameters
logSoftmaxDescriptor- LogSoftmaxDescriptor to configure the log softmax.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1274 of file Network.cpp.

Referenced by Network::GetGuid().

1276 {
1277  return m_Graph->AddLayer<LogSoftmaxLayer>(desc, name);
1278 }

◆ AddLstmLayer()

IConnectableLayer * AddLstmLayer ( const LstmDescriptor descriptor,
const LstmInputParams params,
const char *  name = nullptr 
)
overridevirtual

Add a Lstm layer to the network

Parameters
descriptor- Parameters for the Lstm operation
params- Weights and biases for the LSTM cell
name- Optional name for the layer
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1312 of file Network.cpp.

References LstmLayer::m_BasicParameters, LstmInputParams::m_CellBias, LstmInputParams::m_CellLayerNormWeights, LstmInputParams::m_CellToForgetWeights, LstmInputParams::m_CellToInputWeights, LstmInputParams::m_CellToOutputWeights, LstmInputParams::m_ForgetGateBias, LstmInputParams::m_ForgetLayerNormWeights, LstmInputParams::m_InputGateBias, LstmInputParams::m_InputLayerNormWeights, LstmInputParams::m_InputToCellWeights, LstmInputParams::m_InputToForgetWeights, LstmBasicParameters::m_InputToForgetWeights, LstmInputParams::m_InputToInputWeights, LstmInputParams::m_InputToOutputWeights, LstmInputParams::m_OutputGateBias, LstmInputParams::m_OutputLayerNormWeights, LstmInputParams::m_ProjectionBias, LstmInputParams::m_ProjectionWeights, LstmInputParams::m_RecurrentToCellWeights, LstmInputParams::m_RecurrentToForgetWeights, LstmInputParams::m_RecurrentToInputWeights, and LstmInputParams::m_RecurrentToOutputWeights.

Referenced by armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1315 {
1316  const auto layer = m_Graph->AddLayer<LstmLayer>(descriptor, name);
1317 
1318  //Lstm Basic Parameters
1319  layer->m_BasicParameters.m_InputToForgetWeights =
1320  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToForgetWeights));
1321  layer->m_BasicParameters.m_InputToCellWeights =
1322  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToCellWeights));
1323  layer->m_BasicParameters.m_InputToOutputWeights =
1324  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToOutputWeights));
1325  layer->m_BasicParameters.m_RecurrentToForgetWeights =
1326  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToForgetWeights));
1327  layer->m_BasicParameters.m_RecurrentToCellWeights =
1328  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToCellWeights));
1329  layer->m_BasicParameters.m_RecurrentToOutputWeights =
1330  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToOutputWeights));
1331  layer->m_BasicParameters.m_ForgetGateBias =
1332  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ForgetGateBias));
1333  layer->m_BasicParameters.m_CellBias =
1334  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellBias));
1335  layer->m_BasicParameters.m_OutputGateBias =
1336  std::make_unique<ScopedCpuTensorHandle>(*(params.m_OutputGateBias));
1337 
1338  //Lstm Cifg parameters
1339  if(!descriptor.m_CifgEnabled)
1340  {
1341  if(params.m_InputToInputWeights == nullptr)
1342  {
1343  throw InvalidArgumentException("AddLstmLayer: Input To Input Weights cannot be NULL");
1344  }
1345  if(params.m_RecurrentToInputWeights == nullptr)
1346  {
1347  throw InvalidArgumentException(
1348  "AddLstmLayer: Recurrent To Input Weights cannot be NULL");
1349  }
1350  if(params.m_InputGateBias == nullptr)
1351  {
1352  throw InvalidArgumentException("AddLstmLayer: Input Gate Bias cannot be NULL");
1353  }
1354  layer->m_CifgParameters.m_InputToInputWeights =
1355  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToInputWeights));
1356  layer->m_CifgParameters.m_RecurrentToInputWeights =
1357  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToInputWeights));
1358  // In the VTS tests, cell-to-input weights may be null, even if the other CIFG params are not.
1359  if(params.m_CellToInputWeights != nullptr)
1360  {
1361  layer->m_CifgParameters.m_CellToInputWeights =
1362  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToInputWeights));
1363  }
1364  layer->m_CifgParameters.m_InputGateBias =
1365  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputGateBias));
1366  }
1367 
1368  //Lstm projection parameters
1369  if(descriptor.m_ProjectionEnabled)
1370  {
1371  if(params.m_ProjectionWeights == nullptr)
1372  {
1373  throw InvalidArgumentException("AddLstmLayer: Projection Weights cannot be NULL");
1374  }
1375  layer->m_ProjectionParameters.m_ProjectionWeights =
1376  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionWeights));
1377  if(params.m_ProjectionBias != nullptr)
1378  {
1379  layer->m_ProjectionParameters.m_ProjectionBias =
1380  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionBias));
1381  }
1382  }
1383 
1384  //Lstm Peephole params
1385  if(descriptor.m_PeepholeEnabled)
1386  {
1387  if(params.m_CellToForgetWeights == nullptr)
1388  {
1389  throw InvalidArgumentException("AddLstmLayer: Cell To Forget Weights cannot be NULL");
1390  }
1391  if(params.m_CellToOutputWeights == nullptr)
1392  {
1393  throw InvalidArgumentException("AddLstmLayer: Cell To Output Weights cannot be NULL");
1394  }
1395  layer->m_PeepholeParameters.m_CellToForgetWeights =
1396  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToForgetWeights));
1397  layer->m_PeepholeParameters.m_CellToOutputWeights =
1398  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToOutputWeights));
1399  }
1400 
1401  //Lstm Layer Normalization params
1402  if(descriptor.m_LayerNormEnabled)
1403  {
1404  if(!descriptor.m_CifgEnabled)
1405  {
1406  if(params.m_InputLayerNormWeights == nullptr)
1407  {
1408  throw InvalidArgumentException("AddLstmLayer: Input layer normalization weights cannot be NULL");
1409  }
1410  layer->m_LayerNormParameters.m_InputLayerNormWeights =
1411  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputLayerNormWeights));
1412  }
1413 
1414  if(params.m_ForgetLayerNormWeights == nullptr)
1415  {
1416  throw InvalidArgumentException("AddLstmLayer: Forget layer normalization weights cannot be NULL");
1417  }
1418  if(params.m_CellLayerNormWeights == nullptr)
1419  {
1420  throw InvalidArgumentException("AddLstmLayer: Cell layer normalization weights cannot be NULL");
1421  }
1422  if(params.m_OutputLayerNormWeights == nullptr)
1423  {
1424  throw InvalidArgumentException("AddLstmLayer: Output layer normalization weights cannot be NULL");
1425  }
1426  layer->m_LayerNormParameters.m_ForgetLayerNormWeights =
1427  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ForgetLayerNormWeights));
1428  layer->m_LayerNormParameters.m_CellLayerNormWeights =
1429  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellLayerNormWeights));
1430  layer->m_LayerNormParameters.m_OutputLayerNormWeights =
1431  std::make_unique<ScopedCpuTensorHandle>(*(params.m_OutputLayerNormWeights));
1432  }
1433  return layer;
1434 }

◆ AddMaximumLayer()

IConnectableLayer * AddMaximumLayer ( const char *  name = nullptr)
overridevirtual

Add a Maximum layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1191 of file Network.cpp.

Referenced by Network::GetGuid().

1192 {
1193  return m_Graph->AddLayer<MaximumLayer>(name);
1194 }

◆ AddMeanLayer()

IConnectableLayer * AddMeanLayer ( const MeanDescriptor meanDescriptor,
const char *  name = nullptr 
)
overridevirtual

Add a Mean layer to the network.

Parameters
meanDescriptor- Parameters for the mean operation.
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1446 of file Network.cpp.

Referenced by Network::GetGuid().

1447 {
1448  return m_Graph->AddLayer<MeanLayer>(meanDescriptor,name);
1449 }

◆ AddMergeLayer()

IConnectableLayer * AddMergeLayer ( const char *  name = nullptr)
overridevirtual

Adds a merge layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1492 of file Network.cpp.

Referenced by Network::GetGuid().

1493 {
1494  return m_Graph->AddLayer<MergeLayer>(name);
1495 }

◆ AddMergerLayer()

IConnectableLayer * AddMergerLayer ( const MergerDescriptor mergerDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a concat layer to the network.

Parameters
mergerDescriptor- MergerDescriptor (synonym for OriginsDescriptor) to configure the concatenation process. Number of Views must be equal to the number of inputs, and their order must match - e.g. first view corresponds to the first input, second view to the second input, etc....
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1201 of file Network.cpp.

References Network::AddConcatLayer().

Referenced by Network::GetGuid().

1203 {
1204  return AddConcatLayer(mergerDescriptor, name);
1205 }
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
Definition: Network.cpp:1023

◆ AddMinimumLayer()

IConnectableLayer * AddMinimumLayer ( const char *  name = nullptr)
overridevirtual

Add a Minimum layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1196 of file Network.cpp.

Referenced by Network::GetGuid().

1197 {
1198  return m_Graph->AddLayer<MinimumLayer>(name);
1199 }

◆ AddMultiplicationLayer()

IConnectableLayer * AddMultiplicationLayer ( const char *  name = nullptr)
overridevirtual

Adds a multiplication layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1217 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1218 {
1219  return m_Graph->AddLayer<MultiplicationLayer>(name);
1220 }

◆ AddNormalizationLayer()

IConnectableLayer * AddNormalizationLayer ( const NormalizationDescriptor normalizationDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a normalization layer to the network.

Parameters
normalizationDescriptor- NormalizationDescriptor to configure the normalization.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1167 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1170 {
1171  return m_Graph->AddLayer<NormalizationLayer>(normalizationDescriptor, name);
1172 }

◆ AddOutputLayer()

IConnectableLayer * AddOutputLayer ( LayerBindingId  id,
const char *  name = nullptr 
)
overridevirtual

Adds an output layer to the network.

Parameters
id- User generated id to uniquely identify a particular output. The same id needs to be specified when passing the outputs to the IRuntime::EnqueueWorkload() function.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1222 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1223 {
1224  return m_Graph->AddLayer<OutputLayer>(id, name);
1225 }

◆ AddPadLayer()

IConnectableLayer * AddPadLayer ( const PadDescriptor padDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a fully pad layer to the network.

Parameters
paddings- n by 2 tensor, where n is the rank of the input tensor, such that paddings[i,0] indicates the amount of padding to add in front of dimonsion i, and paddings[i,1] indicates the amount of padding to add after the end of dimension i
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1451 of file Network.cpp.

Referenced by Network::GetGuid().

1452 {
1453  return m_Graph->AddLayer<PadLayer>(padDescriptor,name);
1454 }

◆ AddPermuteLayer()

IConnectableLayer * AddPermuteLayer ( const PermuteDescriptor permuteDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a permute layer to the network.

Parameters
permuteDescriptor- PermuteDescriptor to configure the permute.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1143 of file Network.cpp.

Referenced by Network::GetGuid().

1145 {
1146  return m_Graph->AddLayer<PermuteLayer>(permuteDescriptor, name);
1147 }

◆ AddPooling2dLayer()

IConnectableLayer * AddPooling2dLayer ( const Pooling2dDescriptor pooling2dDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a pooling layer to the network.

Parameters
pooling2dDescriptor- Pooling2dDescriptor to configure the pooling.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1149 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1151 {
1152  return m_Graph->AddLayer<Pooling2dLayer>(pooling2dDescriptor, name);
1153 }

◆ AddPreluLayer()

IConnectableLayer * AddPreluLayer ( const char *  name = nullptr)
overridevirtual

Adds a PReLU layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1502 of file Network.cpp.

Referenced by Network::GetGuid().

1503 {
1504  return m_Graph->AddLayer<PreluLayer>(name);
1505 }

◆ AddQuantizedLstmLayer()

IConnectableLayer * AddQuantizedLstmLayer ( const QuantizedLstmInputParams params,
const char *  name = nullptr 
)
overridevirtual

Add a QuantizedLstm layer to the network

Parameters
params- The weights and biases for the Quantized LSTM cell
name- Optional name for the layer
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1542 of file Network.cpp.

References QuantizedLstmInputParams::GetCellBias(), QuantizedLstmInputParams::GetForgetGateBias(), QuantizedLstmInputParams::GetInputGateBias(), QuantizedLstmInputParams::GetInputToCellWeights(), QuantizedLstmInputParams::GetInputToForgetWeights(), QuantizedLstmInputParams::GetInputToInputWeights(), QuantizedLstmInputParams::GetInputToOutputWeights(), QuantizedLstmInputParams::GetOutputGateBias(), QuantizedLstmInputParams::GetRecurrentToCellWeights(), QuantizedLstmInputParams::GetRecurrentToForgetWeights(), QuantizedLstmInputParams::GetRecurrentToInputWeights(), QuantizedLstmInputParams::GetRecurrentToOutputWeights(), QuantizedLstmParameters::m_InputToInputWeights, and QuantizedLstmLayer::m_QuantizedLstmParameters.

Referenced by armnn::BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1544 {
1545  const auto layer = m_Graph->AddLayer<QuantizedLstmLayer>(name);
1546 
1547  // InputToX weights
1548  layer->m_QuantizedLstmParameters.m_InputToInputWeights =
1549  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToInputWeights());
1550  layer->m_QuantizedLstmParameters.m_InputToForgetWeights =
1551  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToForgetWeights());
1552  layer->m_QuantizedLstmParameters.m_InputToCellWeights =
1553  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToCellWeights());
1554  layer->m_QuantizedLstmParameters.m_InputToOutputWeights =
1555  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToOutputWeights());
1556 
1557  // RecurrentToX weights
1558  layer->m_QuantizedLstmParameters.m_RecurrentToInputWeights =
1559  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToInputWeights());
1560  layer->m_QuantizedLstmParameters.m_RecurrentToForgetWeights =
1561  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToForgetWeights());
1562  layer->m_QuantizedLstmParameters.m_RecurrentToCellWeights =
1563  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToCellWeights());
1564  layer->m_QuantizedLstmParameters.m_RecurrentToOutputWeights =
1565  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToOutputWeights());
1566 
1567  // Bias
1568  layer->m_QuantizedLstmParameters.m_InputGateBias =
1569  std::make_unique<ScopedCpuTensorHandle>(params.GetInputGateBias());
1570  layer->m_QuantizedLstmParameters.m_ForgetGateBias =
1571  std::make_unique<ScopedCpuTensorHandle>(params.GetForgetGateBias());
1572  layer->m_QuantizedLstmParameters.m_CellBias =
1573  std::make_unique<ScopedCpuTensorHandle>(params.GetCellBias());
1574  layer->m_QuantizedLstmParameters.m_OutputGateBias =
1575  std::make_unique<ScopedCpuTensorHandle>(params.GetOutputGateBias());
1576 
1577  return layer;
1578 }

◆ AddQuantizeLayer()

IConnectableLayer * AddQuantizeLayer ( const char *  name = nullptr)
overridevirtual

Add a quantize layer to the network

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1456 of file Network.cpp.

Referenced by Network::GetGuid().

1457 {
1458  return m_Graph->AddLayer<QuantizeLayer>(name);
1459 }

◆ AddReshapeLayer()

IConnectableLayer * AddReshapeLayer ( const ReshapeDescriptor reshapeDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a reshape layer to the network.

Parameters
reshapeDescriptor- Parameters for the reshape operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1289 of file Network.cpp.

Referenced by Network::GetGuid().

1291 {
1292  return m_Graph->AddLayer<ReshapeLayer>(reshapeDescriptor, name);
1293 }

◆ AddResizeBilinearLayer()

IConnectableLayer * AddResizeBilinearLayer ( const ResizeBilinearDescriptor resizeDesc,
const char *  name = nullptr 
)
overridevirtual

Adds a resize bilinear layer to the network.

Parameters
resizeDesc- Parameters for the resize operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1244 of file Network.cpp.

References armnn::Bilinear, ResizeBilinearDescriptor::m_DataLayout, ResizeDescriptor::m_DataLayout, ResizeDescriptor::m_Method, ResizeBilinearDescriptor::m_TargetHeight, ResizeDescriptor::m_TargetHeight, ResizeBilinearDescriptor::m_TargetWidth, and ResizeDescriptor::m_TargetWidth.

Referenced by Network::GetGuid().

1246 {
1247  ResizeDescriptor resizeDescriptor;
1248  resizeDescriptor.m_Method = ResizeMethod::Bilinear;
1249  resizeDescriptor.m_DataLayout = descriptor.m_DataLayout;
1250  resizeDescriptor.m_TargetWidth = descriptor.m_TargetWidth;
1251  resizeDescriptor.m_TargetHeight = descriptor.m_TargetHeight;
1252 
1253  return m_Graph->AddLayer<ResizeLayer>(resizeDescriptor, name);
1254 }

◆ AddResizeLayer()

IConnectableLayer * AddResizeLayer ( const ResizeDescriptor resizeDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a resize layer to the network.

Parameters
resizeDescriptor- Parameters for the resize operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1256 of file Network.cpp.

Referenced by Network::GetGuid().

1258 {
1259  return m_Graph->AddLayer<ResizeLayer>(resizeDescriptor, name);
1260 }

◆ AddRsqrtLayer()

IConnectableLayer * AddRsqrtLayer ( const char *  name = nullptr)
overridevirtual

Add Reciprocal of square root layer to the network.

Parameters
name- Optional name for the layer. @ return - Interface for configuring the layer.

Implements INetwork.

Definition at line 1482 of file Network.cpp.

References Network::AddElementwiseUnaryLayer(), and armnn::Rsqrt.

Referenced by Network::GetGuid().

1483 {
1484  return AddElementwiseUnaryLayer(ElementwiseUnaryDescriptor(UnaryOperation::Rsqrt), name);
1485 }
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
Definition: Network.cpp:970

◆ AddSliceLayer()

IConnectableLayer * AddSliceLayer ( const SliceDescriptor sliceDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a slice layer to the network.

Parameters
sliceDescriptor- SliceDescriptor to configure the slice operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1174 of file Network.cpp.

Referenced by Network::GetGuid().

1175 {
1176  return m_Graph->AddLayer<SliceLayer>(sliceDescriptor, name);
1177 }

◆ AddSoftmaxLayer()

IConnectableLayer * AddSoftmaxLayer ( const SoftmaxDescriptor softmaxDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a softmax layer to the network. If the data type is QAsymm8, then the output quantization parameters must have a scale of 1/256 and an offset of 0

Parameters
softmaxDescriptor- SoftmaxDescriptor to configure the softmax.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1179 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1181 {
1182  return m_Graph->AddLayer<SoftmaxLayer>(softmaxDescriptor, name);
1183 }

◆ AddSpaceToBatchNdLayer()

IConnectableLayer * AddSpaceToBatchNdLayer ( const SpaceToBatchNdDescriptor spaceToBatchNdDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a space to batch layer to the network.

Parameters
spaceToBatchNdDescriptor- Parameters for the space to batch operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1295 of file Network.cpp.

Referenced by Network::GetGuid().

1297 {
1298  return m_Graph->AddLayer<SpaceToBatchNdLayer>(spaceToBatchNdDescriptor, name);
1299 }

◆ AddSpaceToDepthLayer()

IConnectableLayer * AddSpaceToDepthLayer ( const SpaceToDepthDescriptor spaceToDepthDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a space to depth layer to the network.

Parameters
spaceToDepthDescriptor- Parameters for the space to depth operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1301 of file Network.cpp.

Referenced by Network::GetGuid().

1303 {
1304  return m_Graph->AddLayer<SpaceToDepthLayer>(spaceToDepthDescriptor, name);
1305 }

◆ AddSplitterLayer()

IConnectableLayer * AddSplitterLayer ( const ViewsDescriptor splitterDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a splitter layer to the network.

Parameters
splitterDescriptor- ViewsDescriptor to configure the splitting process. Number of Views must be equal to the number of outputs, and their order must match - e.g. first view corresponds to the first output, second view to the second output, etc....
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1185 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1187 {
1188  return m_Graph->AddLayer<SplitterLayer>(splitterDescriptor, name);
1189 }

◆ AddStackLayer()

IConnectableLayer * AddStackLayer ( const StackDescriptor descriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a stack layer to the network.

Parameters
descriptor- Description of the stack layer.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1529 of file Network.cpp.

Referenced by Network::GetGuid().

1531 {
1532  return m_Graph->AddLayer<StackLayer>(stackDescriptor, name);
1533 }

◆ AddStandInLayer()

IConnectableLayer * AddStandInLayer ( const StandInDescriptor descriptor,
const char *  name = nullptr 
)
overridevirtual

Add a stand-in layer for a type unknown to the Arm NN framework. Note: Due to the nature of this layer, no validation can be performed by the framework. Furthermore, Any model containing this layer cannot make use of dynamic tensors since the tensor sizes cannot be inferred. - Descriptor for the StandIn layer.

Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1536 of file Network.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGuid().

1538 {
1539  return m_Graph->AddLayer<StandInLayer>(desc, name);
1540 }

◆ AddStridedSliceLayer()

IConnectableLayer * AddStridedSliceLayer ( const StridedSliceDescriptor stridedSliceDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a strided slice layer to the network.

Parameters
StridedSliceDescriptor- Parameters for the strided slice operation.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1466 of file Network.cpp.

Referenced by Network::GetGuid().

1468 {
1469  return m_Graph->AddLayer<StridedSliceLayer>(stridedSliceDescriptor, name);
1470 }

◆ AddSubtractionLayer()

IConnectableLayer * AddSubtractionLayer ( const char *  name = nullptr)
overridevirtual

Adds a subtraction layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1441 of file Network.cpp.

Referenced by Network::GetGuid().

1442 {
1443  return m_Graph->AddLayer<SubtractionLayer>(name);
1444 }

◆ AddSwitchLayer()

IConnectableLayer * AddSwitchLayer ( const char *  name = nullptr)
overridevirtual

Adds a switch layer to the network.

Parameters
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1497 of file Network.cpp.

Referenced by Network::GetGuid().

1498 {
1499  return m_Graph->AddLayer<SwitchLayer>(name);
1500 }

◆ AddTransposeConvolution2dLayer()

IConnectableLayer * AddTransposeConvolution2dLayer ( const TransposeConvolution2dDescriptor descriptor,
const ConstTensor weights,
const Optional< ConstTensor > &  biases,
const char *  name = nullptr 
)
overridevirtual

Adds a 2D transpose convolution layer to the network.

Parameters
descriptor- Description of the 2D transpose convolution layer.
weights- Tensor for the weights data.
biases- Optional tensor for the bias data.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1507 of file Network.cpp.

References OptionalBase::has_value(), TransposeConvolution2dDescriptor::m_BiasEnabled, TransposeConvolution2dLayer::m_Weight, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().

Referenced by Network::GetGuid().

1511 {
1512  if (descriptor.m_BiasEnabled && !biases.has_value())
1513  {
1514  throw InvalidArgumentException("AddTransposeConvolution2dLayer: Biases cannot be empty");
1515  }
1516 
1517  const auto layer = m_Graph->AddLayer<TransposeConvolution2dLayer>(descriptor, name);
1518 
1519  layer->m_Weight = std::make_unique<ScopedCpuTensorHandle>(weights);
1520 
1521  if (descriptor.m_BiasEnabled)
1522  {
1523  layer->m_Bias = std::make_unique<ScopedCpuTensorHandle>(biases.value());
1524  }
1525 
1526  return layer;
1527 }

◆ GetGraph()

const Graph& GetGraph ( ) const
inline

◆ GetGuid()

profiling::ProfilingGuid GetGuid ( ) const
inlinefinalvirtual

Implements INetwork.

Definition at line 37 of file Network.hpp.

References Network::Accept(), Network::AddAbsLayer(), Network::AddActivationLayer(), Network::AddAdditionLayer(), Network::AddArgMinMaxLayer(), Network::AddBatchNormalizationLayer(), Network::AddBatchToSpaceNdLayer(), Network::AddComparisonLayer(), Network::AddConcatLayer(), Network::AddConstantLayer(), Network::AddConvolution2dLayer(), Network::AddDepthToSpaceLayer(), Network::AddDepthwiseConvolution2dLayer(), Network::AddDequantizeLayer(), Network::AddDetectionPostProcessLayer(), Network::AddDivisionLayer(), Network::AddElementwiseUnaryLayer(), Network::AddEqualLayer(), Network::AddFloorLayer(), Network::AddFullyConnectedLayer(), Network::AddGatherLayer(), Network::AddGreaterLayer(), Network::AddInputLayer(), Network::AddInstanceNormalizationLayer(), Network::AddL2NormalizationLayer(), Network::AddLogSoftmaxLayer(), Network::AddLstmLayer(), Network::AddMaximumLayer(), Network::AddMeanLayer(), Network::AddMergeLayer(), Network::AddMergerLayer(), Network::AddMinimumLayer(), Network::AddMultiplicationLayer(), Network::AddNormalizationLayer(), Network::AddOutputLayer(), Network::AddPadLayer(), Network::AddPermuteLayer(), Network::AddPooling2dLayer(), Network::AddPreluLayer(), Network::AddQuantizedLstmLayer(), Network::AddQuantizeLayer(), Network::AddReshapeLayer(), Network::AddResizeBilinearLayer(), Network::AddResizeLayer(), Network::AddRsqrtLayer(), Network::AddSliceLayer(), Network::AddSoftmaxLayer(), Network::AddSpaceToBatchNdLayer(), Network::AddSpaceToDepthLayer(), Network::AddSplitterLayer(), Network::AddStackLayer(), Network::AddStandInLayer(), Network::AddStridedSliceLayer(), Network::AddSubtractionLayer(), Network::AddSwitchLayer(), Network::AddTransposeConvolution2dLayer(), anchors(), and ARMNN_DEPRECATED_MSG.

37 { return m_Guid; };

◆ PrintGraph()

Status PrintGraph ( )
overridevirtual

Implements INetwork.

Definition at line 947 of file Network.cpp.

References armnn::Success.

Referenced by BOOST_AUTO_TEST_CASE(), and Network::GetGraph().

948 {
949  m_Graph->Print();
950  return Status::Success;
951 }

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