ArmNN
 20.08
Network Class Referencefinal

Private implementation of INetwork. More...

#include <Network.hpp>

Inheritance diagram for Network:
INetwork

Public Member Functions

 Network (NetworkOptions networkOptions={})
 
 ~Network ()
 
const GraphGetGraph () const
 
Status PrintGraph () override
 
IConnectableLayerAddInputLayer (LayerBindingId id, const char *name=nullptr) override
 Adds an input layer to the network. More...
 
IConnectableLayerAddArgMinMaxLayer (const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
 Adds an ArgMinMax layer to the network. More...
 
IConnectableLayerAddBatchToSpaceNdLayer (const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
 Adds a batch to space ND layer to the network. More...
 
IConnectableLayerAddComparisonLayer (const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
 Add a Comparison layer to the network. More...
 
IConnectableLayerAddConcatLayer (const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
 Adds a concatenation layer to the network. More...
 
IConnectableLayerAddConvolution2dLayer (const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 Adds a 2D convolution layer to the network. More...
 
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
 Adds a depth to space layer to the network. More...
 
IConnectableLayerAddDepthwiseConvolution2dLayer (const DepthwiseConvolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 Adds a 2D depthwise convolution layer to the network. More...
 
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
 Adds a Dequantize layer to the network. More...
 
IConnectableLayerAddDetectionPostProcessLayer (const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr) override
 Adds a Detection PostProcess layer to the network. More...
 
IConnectableLayerAddElementwiseUnaryLayer (const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
 Add an ElementwiseUnary layer to the network. More...
 
IConnectableLayerAddFillLayer (const FillDescriptor &fillDescriptor, const char *name=nullptr) override
 Add an Fill layer to the network. More...
 
IConnectableLayerAddFullyConnectedLayer (const FullyConnectedDescriptor &fullyConnectedDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 Adds a fully connected layer to the network. More...
 
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
 Add Gather layer to the network. More...
 
IConnectableLayerAddGatherLayer (const GatherDescriptor &gatherDescriptor, const char *name=nullptr) override
 Add Gather layer to the network. More...
 
IConnectableLayerAddPermuteLayer (const PermuteDescriptor &permuteDescriptor, const char *name=nullptr) override
 Adds a permute layer to the network. More...
 
IConnectableLayerAddPooling2dLayer (const Pooling2dDescriptor &pooling2dDescriptor, const char *name=nullptr) override
 Adds a pooling layer to the network. More...
 
IConnectableLayerAddActivationLayer (const ActivationDescriptor &activationDescriptor, const char *name=nullptr) override
 Adds an activation layer to the network. More...
 
IConnectableLayerAddNormalizationLayer (const NormalizationDescriptor &normalizationDescriptor, const char *name=nullptr) override
 Adds a normalization layer to the network. More...
 
IConnectableLayerAddSliceLayer (const SliceDescriptor &sliceDescriptor, const char *name=nullptr) override
 Adds a slice layer to the network. More...
 
IConnectableLayerAddSoftmaxLayer (const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
 Adds a softmax layer to the network. More...
 
IConnectableLayerAddSplitterLayer (const ViewsDescriptor &splitterDescriptor, const char *name=nullptr) override
 Adds a splitter layer to the network. More...
 
IConnectableLayerAddMergerLayer (const MergerDescriptor &mergerDescriptor, const char *name=nullptr) override
 Adds a concat layer to the network. More...
 
IConnectableLayerAddAbsLayer (const char *name=nullptr) override
 Add absolute layer to the network. More...
 
IConnectableLayerAddAdditionLayer (const char *name=nullptr) override
 Adds an addition layer to the network. More...
 
IConnectableLayerAddMultiplicationLayer (const char *name=nullptr) override
 Adds a multiplication layer to the network. More...
 
IConnectableLayerAddBatchNormalizationLayer (const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr) override
 Adds a batch normalization layer to the network. More...
 
IConnectableLayerAddRankLayer (const char *name=nullptr) override
 Adds a rank layer to the network. More...
 
IConnectableLayerAddResizeBilinearLayer (const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
 Adds a resize bilinear layer to the network. More...
 
IConnectableLayerAddResizeLayer (const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
 Adds a resize layer to the network. More...
 
IConnectableLayerAddInstanceNormalizationLayer (const InstanceNormalizationDescriptor &desc, const char *name=nullptr) override
 Adds an instance normalization layer to the network. More...
 
IConnectableLayerAddL2NormalizationLayer (const L2NormalizationDescriptor &desc, const char *name=nullptr) override
 Adds an L2 normalization layer to the network. More...
 
IConnectableLayerAddLogSoftmaxLayer (const LogSoftmaxDescriptor &logSoftmaxDescriptor, const char *name=nullptr) override
 Adds a log softmax layer to the network. More...
 
IConnectableLayerAddConstantLayer (const ConstTensor &input, const char *name=nullptr) override
 Adds a layer with no inputs and a single output, which always corresponds to the passed in constant tensor. More...
 
IConnectableLayerAddReshapeLayer (const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr) override
 Adds a reshape layer to the network. More...
 
IConnectableLayerAddSpaceToBatchNdLayer (const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
 Adds a space to batch layer to the network. More...
 
IConnectableLayerAddSpaceToDepthLayer (const SpaceToDepthDescriptor &spaceToDepthDescriptor, const char *name=nullptr) override
 Adds a space to depth layer to the network. More...
 
IConnectableLayerAddFloorLayer (const char *name=nullptr) override
 Adds a floor layer to the network. More...
 
IConnectableLayerAddOutputLayer (LayerBindingId id, const char *name=nullptr) override
 Adds an output layer to the network. More...
 
IConnectableLayerAddLstmLayer (const LstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
 Add a Lstm layer to the network. More...
 
IConnectableLayerAddDivisionLayer (const char *name=nullptr) override
 Adds a division layer to the network. More...
 
IConnectableLayerAddSubtractionLayer (const char *name=nullptr) override
 Adds a subtraction layer to the network. More...
 
IConnectableLayerAddMaximumLayer (const char *name=nullptr) override
 Add a Maximum layer to the network. More...
 
IConnectableLayerAddMeanLayer (const MeanDescriptor &meanDescriptor, const char *name=nullptr) override
 Add a Mean layer to the network. More...
 
IConnectableLayerAddPadLayer (const PadDescriptor &padDescriptor, const char *name=nullptr) override
 Adds a fully pad layer to the network. More...
 
IConnectableLayerAddQuantizeLayer (const char *name=nullptr) override
 Add a quantize layer to the network. More...
 
IConnectableLayerAddStridedSliceLayer (const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
 Adds a strided slice layer to the network. More...
 
IConnectableLayerAddMinimumLayer (const char *name=nullptr) override
 Add a Minimum layer to the network. More...
 
IConnectableLayerAddGreaterLayer (const char *name=nullptr) override
 Add a Greater layer to the network. More...
 
IConnectableLayerAddEqualLayer (const char *name=nullptr) override
 Add a Equal layer to the network. More...
 
IConnectableLayerAddRsqrtLayer (const char *name=nullptr) override
 Add Reciprocal of square root layer to the network. More...
 
IConnectableLayerAddMergeLayer (const char *name=nullptr) override
 Adds a merge layer to the network. More...
 
IConnectableLayerAddSwitchLayer (const char *name=nullptr) override
 Adds a switch layer to the network. More...
 
IConnectableLayerAddPreluLayer (const char *name=nullptr) override
 Adds a PReLU layer to the network. More...
 
IConnectableLayerAddTransposeConvolution2dLayer (const TransposeConvolution2dDescriptor &descriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
 Adds a 2D transpose convolution layer to the network. More...
 
IConnectableLayerAddTransposeLayer (const TransposeDescriptor &transposeDescriptor, const char *name=nullptr) override
 Adds a transpose layer to the network. More...
 
IConnectableLayerAddStackLayer (const StackDescriptor &stackDescriptor, const char *name=nullptr) override
 Adds a stack layer to the network. More...
 
IConnectableLayerAddStandInLayer (const StandInDescriptor &descriptor, const char *name=nullptr) override
 Add a stand-in layer for a type unknown to the Arm NN framework. More...
 
IConnectableLayerAddQLstmLayer (const QLstmDescriptor &descriptor, const LstmInputParams &params, const char *name=nullptr) override
 Add a QLstm layer to the network. More...
 
IConnectableLayerAddQuantizedLstmLayer (const QuantizedLstmInputParams &params, const char *name=nullptr) override
 Add a QuantizedLstm layer to the network. More...
 
void Accept (ILayerVisitor &visitor) const override
 

Additional Inherited Members

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

Detailed Description

Private implementation of INetwork.

Definition at line 28 of file Network.hpp.

Constructor & Destructor Documentation

◆ Network()

Network ( NetworkOptions  networkOptions = {})

Definition at line 1171 of file Network.cpp.

1172 : m_NetworkOptions(networkOptions),
1173  m_Graph(std::make_unique<Graph>(GetShapeInferenceMethod()))
1174 {}

◆ ~Network()

~Network ( )

Definition at line 1176 of file Network.cpp.

1177 {
1178 }

Member Function Documentation

◆ Accept()

void Accept ( ILayerVisitor visitor) const
overridevirtual

Implements INetwork.

Definition at line 1998 of file Network.cpp.

References Network::GetGraph().

Referenced by Network::GetGraph().

1999 {
2000  for (auto layer : GetGraph())
2001  {
2002  layer->Accept(visitor);
2003  };
2004 }
const Graph & GetGraph() const
Definition: Network.hpp:34

◆ AddAbsLayer()

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

Add absolute layer to the network.

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

Implements INetwork.

Definition at line 1446 of file Network.cpp.

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

Referenced by Network::GetGraph().

1447 {
1448  return AddElementwiseUnaryLayer(ElementwiseUnaryDescriptor(UnaryOperation::Abs), name);
1449 }
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
Add an ElementwiseUnary layer to the network.
Definition: Network.cpp:1203

◆ 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 1394 of file Network.cpp.

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

1396 {
1397  return m_Graph->AddLayer<ActivationLayer>(activationDescriptor, name);
1398 }

◆ 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 1451 of file Network.cpp.

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

1452 {
1453  return m_Graph->AddLayer<AdditionLayer>(name);
1454 }

◆ 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 1400 of file Network.cpp.

Referenced by Network::GetGraph().

1402 {
1403  return m_Graph->AddLayer<ArgMinMaxLayer>(argMinMaxDescriptor, name);
1404 }

◆ 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 1466 of file Network.cpp.

References BatchNormalizationLayer::m_Mean.

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

1472 {
1473  const auto layer = m_Graph->AddLayer<BatchNormalizationLayer>(desc, name);
1474 
1475  layer->m_Mean = std::make_unique<ScopedCpuTensorHandle>(mean);
1476  layer->m_Variance = std::make_unique<ScopedCpuTensorHandle>(variance);
1477  layer->m_Beta = std::make_unique<ScopedCpuTensorHandle>(beta);
1478  layer->m_Gamma = std::make_unique<ScopedCpuTensorHandle>(gamma);
1479 
1480  return layer;
1481 }

◆ 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 1191 of file Network.cpp.

Referenced by Network::GetGraph().

1193 {
1194  return m_Graph->AddLayer<BatchToSpaceNdLayer>(batchToSpaceNdDescriptor, name);
1195 }

◆ 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.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1197 of file Network.cpp.

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

1199 {
1200  return m_Graph->AddLayer<ComparisonLayer>(comparisonDescriptor, name);
1201 }

◆ 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 1262 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::GetGraph().

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

◆ 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 1526 of file Network.cpp.

References ConstantLayer::m_LayerOutput.

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

1527 {
1528  auto layer = m_Graph->AddLayer<ConstantLayer>(name);
1529 
1530  layer->m_LayerOutput = std::make_unique<ScopedCpuTensorHandle>(input);
1531 
1532  return layer;
1533 }

◆ 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 1290 of file Network.cpp.

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

1294 {
1295  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1296 }

◆ AddConvolution2dLayer() [2/3]

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

Implements INetwork.

Definition at line 1298 of file Network.cpp.

1301 {
1302  Optional<ConstTensor> biases;
1303  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1304 }

◆ AddConvolution2dLayer() [3/3]

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

Implements INetwork.

Definition at line 1306 of file Network.cpp.

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

1310 {
1311  Optional<ConstTensor> optionalBiases(biases);
1312  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name);
1313 }

◆ 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 1338 of file Network.cpp.

Referenced by Network::GetGraph().

1340 {
1341  return m_Graph->AddLayer<DepthToSpaceLayer>(depthToSpaceDescriptor, name);
1342 }

◆ 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 1344 of file Network.cpp.

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

1349 {
1350  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1351 }

◆ AddDepthwiseConvolution2dLayer() [2/3]

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

Implements INetwork.

Definition at line 1353 of file Network.cpp.

1357 {
1358  Optional<ConstTensor> biases;
1359  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1360 }

◆ AddDepthwiseConvolution2dLayer() [3/3]

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

Implements INetwork.

Definition at line 1362 of file Network.cpp.

1367 {
1368  Optional<ConstTensor> optionalBiases(biases);
1369  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name);
1370 }

◆ 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 1724 of file Network.cpp.

Referenced by Network::GetGraph().

1725 {
1726  return m_Graph->AddLayer<DequantizeLayer>(name);
1727 }

◆ 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 1372 of file Network.cpp.

References anchors(), and DetectionPostProcessLayer::m_Anchors.

Referenced by Network::GetGraph().

1374 {
1375  const auto layer = m_Graph->AddLayer<DetectionPostProcessLayer>(descriptor, name);
1376 
1377  layer->m_Anchors = std::make_unique<ScopedCpuTensorHandle>(anchors);
1378 
1379  return layer;
1380 }
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 1699 of file Network.cpp.

Referenced by Network::GetGraph().

1700 {
1701  return m_Graph->AddLayer<DivisionLayer>(name);
1702 }

◆ 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.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1203 of file Network.cpp.

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

1205 {
1206  return m_Graph->AddLayer<ElementwiseUnaryLayer>(elementwiseUnaryDescriptor, name);
1207 }

◆ AddEqualLayer()

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

Add a Equal layer to the network.

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

Implements INetwork.

Definition at line 1740 of file Network.cpp.

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

Referenced by Network::GetGraph().

1741 {
1742  return AddComparisonLayer(ComparisonDescriptor(ComparisonOperation::Equal), name);
1743 }
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Add a Comparison layer to the network.
Definition: Network.cpp:1197

◆ AddFillLayer()

IConnectableLayer * AddFillLayer ( const FillDescriptor fillDescriptor,
const char *  name = nullptr 
)
overridevirtual

Add an Fill layer to the network.

Parameters
name- Optional name for the layer.
fillDescriptor- Descriptor for the fill operation.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1209 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::GetGraph().

1211 {
1212  return m_Graph->AddLayer<FillLayer>(fillDescriptor, name);
1213 }

◆ 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 1553 of file Network.cpp.

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

1554 {
1555  return m_Graph->AddLayer<FloorLayer>(name);
1556 }

◆ 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 1237 of file Network.cpp.

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

1241 {
1242  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, biases, name);
1243 }

◆ AddFullyConnectedLayer() [2/3]

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

Implements INetwork.

Definition at line 1245 of file Network.cpp.

1248 {
1249  Optional<ConstTensor> biases;
1250  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, biases, name);
1251 }

◆ AddFullyConnectedLayer() [3/3]

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

Implements INetwork.

Definition at line 1253 of file Network.cpp.

1257 {
1258  Optional<ConstTensor> optionalBiases(biases);
1259  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, optionalBiases, name);
1260 }

◆ AddGatherLayer() [1/2]

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

Add Gather layer to the network.

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

Implements INetwork.

Definition at line 1750 of file Network.cpp.

Referenced by Network::GetGraph().

1751 {
1752  GatherDescriptor gatherDescriptor{};
1753  return AddGatherLayer(gatherDescriptor, name);
1754 }
IConnectableLayer * AddGatherLayer(const char *name=nullptr) override
Add Gather layer to the network.
Definition: Network.cpp:1750

◆ AddGatherLayer() [2/2]

IConnectableLayer * AddGatherLayer ( const GatherDescriptor descriptor,
const char *  name = nullptr 
)
overridevirtual

Add Gather layer to the network.

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

Implements INetwork.

Definition at line 1756 of file Network.cpp.

1758 {
1759  return m_Graph->AddLayer<GatherLayer>(gatherDescriptor, name);
1760 }

◆ AddGreaterLayer()

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

Add a Greater layer to the network.

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

Implements INetwork.

Definition at line 1735 of file Network.cpp.

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

Referenced by Network::GetGraph().

1736 {
1737  return AddComparisonLayer(ComparisonDescriptor(ComparisonOperation::Greater), name);
1738 }
IConnectableLayer * AddComparisonLayer(const ComparisonDescriptor &comparisonDescriptor, const char *name=nullptr) override
Add a Comparison layer to the network.
Definition: Network.cpp:1197

◆ 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 1186 of file Network.cpp.

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

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

◆ 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 1508 of file Network.cpp.

Referenced by Network::GetGraph().

1510 {
1511  return m_Graph->AddLayer<InstanceNormalizationLayer>(desc, name);
1512 }

◆ 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 1514 of file Network.cpp.

Referenced by Network::GetGraph().

1516 {
1517  return m_Graph->AddLayer<L2NormalizationLayer>(desc, name);
1518 }

◆ 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 1520 of file Network.cpp.

Referenced by Network::GetGraph().

1522 {
1523  return m_Graph->AddLayer<LogSoftmaxLayer>(desc, name);
1524 }

◆ 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 1558 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::GetGraph().

1561 {
1562  const auto layer = m_Graph->AddLayer<LstmLayer>(descriptor, name);
1563 
1564  //Lstm Basic Parameters
1565  layer->m_BasicParameters.m_InputToForgetWeights =
1566  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToForgetWeights));
1567  layer->m_BasicParameters.m_InputToCellWeights =
1568  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToCellWeights));
1569  layer->m_BasicParameters.m_InputToOutputWeights =
1570  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToOutputWeights));
1571  layer->m_BasicParameters.m_RecurrentToForgetWeights =
1572  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToForgetWeights));
1573  layer->m_BasicParameters.m_RecurrentToCellWeights =
1574  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToCellWeights));
1575  layer->m_BasicParameters.m_RecurrentToOutputWeights =
1576  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToOutputWeights));
1577  layer->m_BasicParameters.m_ForgetGateBias =
1578  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ForgetGateBias));
1579  layer->m_BasicParameters.m_CellBias =
1580  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellBias));
1581  layer->m_BasicParameters.m_OutputGateBias =
1582  std::make_unique<ScopedCpuTensorHandle>(*(params.m_OutputGateBias));
1583 
1584  //Lstm Cifg parameters
1585  if(!descriptor.m_CifgEnabled)
1586  {
1587  if(params.m_InputToInputWeights == nullptr)
1588  {
1589  throw InvalidArgumentException("AddLstmLayer: Input To Input Weights cannot be NULL "
1590  "when CIFG is disabled.");
1591  }
1592  if(params.m_RecurrentToInputWeights == nullptr)
1593  {
1594  throw InvalidArgumentException(
1595  "AddLstmLayer: Recurrent To Input Weights cannot be NULL "
1596  "when CIFG is disabled.");
1597  }
1598  if(params.m_InputGateBias == nullptr)
1599  {
1600  throw InvalidArgumentException("AddLstmLayer: Input Gate Bias cannot be NULL "
1601  "when CIFG is disabled.");
1602  }
1603  layer->m_CifgParameters.m_InputToInputWeights =
1604  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToInputWeights));
1605  layer->m_CifgParameters.m_RecurrentToInputWeights =
1606  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToInputWeights));
1607  layer->m_CifgParameters.m_InputGateBias =
1608  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputGateBias));
1609  }
1610 
1611  //Lstm projection parameters
1612  if(descriptor.m_ProjectionEnabled)
1613  {
1614  if(params.m_ProjectionWeights == nullptr)
1615  {
1616  throw InvalidArgumentException("AddLstmLayer: Projection Weights cannot be NULL "
1617  "when projection is enabled.");
1618  }
1619  layer->m_ProjectionParameters.m_ProjectionWeights =
1620  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionWeights));
1621  if(params.m_ProjectionBias != nullptr)
1622  {
1623  layer->m_ProjectionParameters.m_ProjectionBias =
1624  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionBias));
1625  }
1626  }
1627 
1628  //Lstm Peephole params
1629  if(descriptor.m_PeepholeEnabled)
1630  {
1631  if(!descriptor.m_CifgEnabled)
1632  {
1633  if(params.m_CellToInputWeights == nullptr)
1634  {
1635  throw InvalidArgumentException("AddLstmLayer: Cell To Input Weights cannot be NULL "
1636  "when Peephole is enabled and CIFG disabled.");
1637  }
1638 
1639  layer->m_PeepholeParameters.m_CellToInputWeights =
1640  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToInputWeights));
1641  }
1642 
1643  if(params.m_CellToForgetWeights == nullptr)
1644  {
1645  throw InvalidArgumentException("AddLstmLayer: Cell To Forget Weights cannot be NULL "
1646  "when Peephole is enabled.");
1647  }
1648  if(params.m_CellToOutputWeights == nullptr)
1649  {
1650  throw InvalidArgumentException("AddLstmLayer: Cell To Output Weights cannot be NULL "
1651  "when Peephole is enabled.");
1652  }
1653 
1654  layer->m_PeepholeParameters.m_CellToForgetWeights =
1655  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToForgetWeights));
1656  layer->m_PeepholeParameters.m_CellToOutputWeights =
1657  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToOutputWeights));
1658  }
1659 
1660  //Lstm Layer Normalization params
1661  if(descriptor.m_LayerNormEnabled)
1662  {
1663  if(!descriptor.m_CifgEnabled)
1664  {
1665  if(params.m_InputLayerNormWeights == nullptr)
1666  {
1667  throw InvalidArgumentException("AddLstmLayer: Input layer normalization weights cannot be NULL "
1668  "when layer normalization is enabled and CIFG disabled.");
1669  }
1670  layer->m_LayerNormParameters.m_InputLayerNormWeights =
1671  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputLayerNormWeights));
1672  }
1673 
1674  if(params.m_ForgetLayerNormWeights == nullptr)
1675  {
1676  throw InvalidArgumentException("AddLstmLayer: Forget layer normalization weights cannot be NULL "
1677  "when layer normalization is enabled.");
1678  }
1679  if(params.m_CellLayerNormWeights == nullptr)
1680  {
1681  throw InvalidArgumentException("AddLstmLayer: Cell layer normalization weights cannot be NULL "
1682  "when layer normalization is enabled.");
1683  }
1684  if(params.m_OutputLayerNormWeights == nullptr)
1685  {
1686  throw InvalidArgumentException("AddLstmLayer: Output layer normalization weights cannot be NULL "
1687  "when layer normalization is enabled.");
1688  }
1689  layer->m_LayerNormParameters.m_ForgetLayerNormWeights =
1690  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ForgetLayerNormWeights));
1691  layer->m_LayerNormParameters.m_CellLayerNormWeights =
1692  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellLayerNormWeights));
1693  layer->m_LayerNormParameters.m_OutputLayerNormWeights =
1694  std::make_unique<ScopedCpuTensorHandle>(*(params.m_OutputLayerNormWeights));
1695  }
1696  return layer;
1697 }

◆ AddMaximumLayer()

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

Add a Maximum layer to the network.

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

Implements INetwork.

Definition at line 1430 of file Network.cpp.

Referenced by Network::GetGraph().

1431 {
1432  return m_Graph->AddLayer<MaximumLayer>(name);
1433 }

◆ 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.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1709 of file Network.cpp.

Referenced by Network::GetGraph().

1710 {
1711  return m_Graph->AddLayer<MeanLayer>(meanDescriptor,name);
1712 }

◆ 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 1762 of file Network.cpp.

Referenced by Network::GetGraph().

1763 {
1764  return m_Graph->AddLayer<MergeLayer>(name);
1765 }

◆ 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 1440 of file Network.cpp.

References Network::AddConcatLayer().

Referenced by Network::GetGraph().

1442 {
1443  return AddConcatLayer(mergerDescriptor, name);
1444 }
IConnectableLayer * AddConcatLayer(const ConcatDescriptor &concatDescriptor, const char *name=nullptr) override
Adds a concatenation layer to the network.
Definition: Network.cpp:1262

◆ AddMinimumLayer()

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

Add a Minimum layer to the network.

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

Implements INetwork.

Definition at line 1435 of file Network.cpp.

Referenced by Network::GetGraph().

1436 {
1437  return m_Graph->AddLayer<MinimumLayer>(name);
1438 }

◆ 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 1456 of file Network.cpp.

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

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

◆ 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 1406 of file Network.cpp.

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

1409 {
1410  return m_Graph->AddLayer<NormalizationLayer>(normalizationDescriptor, name);
1411 }

◆ 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 1461 of file Network.cpp.

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

1462 {
1463  return m_Graph->AddLayer<OutputLayer>(id, name);
1464 }

◆ 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 1714 of file Network.cpp.

Referenced by Network::GetGraph().

1715 {
1716  return m_Graph->AddLayer<PadLayer>(padDescriptor,name);
1717 }

◆ 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 1382 of file Network.cpp.

Referenced by Network::GetGraph().

1384 {
1385  return m_Graph->AddLayer<PermuteLayer>(permuteDescriptor, name);
1386 }

◆ 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 1388 of file Network.cpp.

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

1390 {
1391  return m_Graph->AddLayer<Pooling2dLayer>(pooling2dDescriptor, name);
1392 }

◆ 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 1772 of file Network.cpp.

Referenced by Network::GetGraph().

1773 {
1774  return m_Graph->AddLayer<PreluLayer>(name);
1775 }

◆ AddQLstmLayer()

IConnectableLayer * AddQLstmLayer ( const QLstmDescriptor descriptor,
const LstmInputParams params,
const char *  name = nullptr 
)
overridevirtual

Add a QLstm layer to the network.

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

Implements INetwork.

Definition at line 1856 of file Network.cpp.

References QLstmLayer::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, QLstmBasicParameters::m_InputToForgetWeights, LstmInputParams::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::GetGraph().

1859 {
1860  const auto layer = m_Graph->AddLayer<QLstmLayer>(descriptor, name);
1861 
1862  // QLstm Basic Parameters
1863  layer->m_BasicParameters.m_InputToForgetWeights =
1864  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToForgetWeights));
1865  layer->m_BasicParameters.m_InputToCellWeights =
1866  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToCellWeights));
1867  layer->m_BasicParameters.m_InputToOutputWeights =
1868  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToOutputWeights));
1869  layer->m_BasicParameters.m_RecurrentToForgetWeights =
1870  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToForgetWeights));
1871  layer->m_BasicParameters.m_RecurrentToCellWeights =
1872  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToCellWeights));
1873  layer->m_BasicParameters.m_RecurrentToOutputWeights =
1874  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToOutputWeights));
1875  layer->m_BasicParameters.m_ForgetGateBias =
1876  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ForgetGateBias));
1877  layer->m_BasicParameters.m_CellBias =
1878  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellBias));
1879  layer->m_BasicParameters.m_OutputGateBias =
1880  std::make_unique<ScopedCpuTensorHandle>(*(params.m_OutputGateBias));
1881 
1882  // QLstm Cifg parameters
1883  if(!descriptor.m_CifgEnabled)
1884  {
1885  if(params.m_InputToInputWeights == nullptr)
1886  {
1887  throw InvalidArgumentException("AddQLstmLayer: Input To Input Weights cannot be NULL");
1888  }
1889 
1890  if(params.m_RecurrentToInputWeights == nullptr)
1891  {
1892  throw InvalidArgumentException(
1893  "AddQLstmLayer: Recurrent To Input Weights cannot be NULL");
1894  }
1895 
1896  if(params.m_InputGateBias == nullptr)
1897  {
1898  throw InvalidArgumentException("AddQLstmLayer: Input Gate Bias cannot be NULL");
1899  }
1900 
1901  layer->m_CifgParameters.m_InputToInputWeights =
1902  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputToInputWeights));
1903  layer->m_CifgParameters.m_RecurrentToInputWeights =
1904  std::make_unique<ScopedCpuTensorHandle>(*(params.m_RecurrentToInputWeights));
1905  layer->m_CifgParameters.m_InputGateBias =
1906  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputGateBias));
1907  }
1908 
1909  // QLstm Projection parameters
1910  if(descriptor.m_ProjectionEnabled)
1911  {
1912  if(params.m_ProjectionWeights == nullptr)
1913  {
1914  throw InvalidArgumentException("AddQLstmLayer: Projection Weights cannot be NULL");
1915  }
1916 
1917  layer->m_ProjectionParameters.m_ProjectionWeights =
1918  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionWeights));
1919 
1920  // Projection bias is optional even if projection is enabled
1921  if(params.m_ProjectionWeights != nullptr)
1922  {
1923  layer->m_ProjectionParameters.m_ProjectionBias =
1924  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionBias));
1925  }
1926 
1927  }
1928 
1929  // QLstm Peephole params
1930  if(descriptor.m_PeepholeEnabled)
1931  {
1932  if(params.m_CellToForgetWeights == nullptr)
1933  {
1934  throw InvalidArgumentException("AddQLstmLayer: Cell To Forget Weights cannot be NULL");
1935  }
1936 
1937  if(params.m_CellToOutputWeights == nullptr)
1938  {
1939  throw InvalidArgumentException("AddQLstmLayer: Cell To Output Weights cannot be NULL");
1940  }
1941 
1942  if(!descriptor.m_CifgEnabled)
1943  {
1944  if(params.m_CellToInputWeights == nullptr)
1945  {
1946  throw InvalidArgumentException("AddQLstmLayer: Cell To Input Weights cannot be NULL");
1947  }
1948 
1949  layer->m_PeepholeParameters.m_CellToInputWeights =
1950  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToInputWeights));
1951  }
1952 
1953  layer->m_PeepholeParameters.m_CellToForgetWeights =
1954  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToForgetWeights));
1955  layer->m_PeepholeParameters.m_CellToOutputWeights =
1956  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellToOutputWeights));
1957  }
1958 
1959  // QLstm Layer Normalization params
1960  if(descriptor.m_LayerNormEnabled)
1961  {
1962  if(params.m_ForgetLayerNormWeights == nullptr)
1963  {
1964  throw InvalidArgumentException("AddQLstmLayer: Forget layer normalization weights cannot be NULL");
1965  }
1966 
1967  if(params.m_CellLayerNormWeights == nullptr)
1968  {
1969  throw InvalidArgumentException("AddQLstmLayer: Cell layer normalization weights cannot be NULL");
1970  }
1971 
1972  if(params.m_OutputLayerNormWeights == nullptr)
1973  {
1974  throw InvalidArgumentException("AddQLstmLayer: Output layer normalization weights cannot be NULL");
1975  }
1976 
1977  if(!descriptor.m_CifgEnabled)
1978  {
1979  if(params.m_InputLayerNormWeights == nullptr)
1980  {
1981  throw InvalidArgumentException("AddQLstmLayer: Input layer normalization weights cannot be NULL");
1982  }
1983 
1984  layer->m_LayerNormParameters.m_InputLayerNormWeights =
1985  std::make_unique<ScopedCpuTensorHandle>(*(params.m_InputLayerNormWeights));
1986  }
1987 
1988  layer->m_LayerNormParameters.m_ForgetLayerNormWeights =
1989  std::make_unique<ScopedCpuTensorHandle>(*(params.m_ForgetLayerNormWeights));
1990  layer->m_LayerNormParameters.m_CellLayerNormWeights =
1991  std::make_unique<ScopedCpuTensorHandle>(*(params.m_CellLayerNormWeights));
1992  layer->m_LayerNormParameters.m_OutputLayerNormWeights =
1993  std::make_unique<ScopedCpuTensorHandle>(*(params.m_OutputLayerNormWeights));
1994  }
1995  return layer;
1996 }

◆ 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 1818 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::GetGraph().

1820 {
1821  const auto layer = m_Graph->AddLayer<QuantizedLstmLayer>(name);
1822 
1823  // InputToX weights
1824  layer->m_QuantizedLstmParameters.m_InputToInputWeights =
1825  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToInputWeights());
1826  layer->m_QuantizedLstmParameters.m_InputToForgetWeights =
1827  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToForgetWeights());
1828  layer->m_QuantizedLstmParameters.m_InputToCellWeights =
1829  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToCellWeights());
1830  layer->m_QuantizedLstmParameters.m_InputToOutputWeights =
1831  std::make_unique<ScopedCpuTensorHandle>(params.GetInputToOutputWeights());
1832 
1833  // RecurrentToX weights
1834  layer->m_QuantizedLstmParameters.m_RecurrentToInputWeights =
1835  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToInputWeights());
1836  layer->m_QuantizedLstmParameters.m_RecurrentToForgetWeights =
1837  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToForgetWeights());
1838  layer->m_QuantizedLstmParameters.m_RecurrentToCellWeights =
1839  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToCellWeights());
1840  layer->m_QuantizedLstmParameters.m_RecurrentToOutputWeights =
1841  std::make_unique<ScopedCpuTensorHandle>(params.GetRecurrentToOutputWeights());
1842 
1843  // Bias
1844  layer->m_QuantizedLstmParameters.m_InputGateBias =
1845  std::make_unique<ScopedCpuTensorHandle>(params.GetInputGateBias());
1846  layer->m_QuantizedLstmParameters.m_ForgetGateBias =
1847  std::make_unique<ScopedCpuTensorHandle>(params.GetForgetGateBias());
1848  layer->m_QuantizedLstmParameters.m_CellBias =
1849  std::make_unique<ScopedCpuTensorHandle>(params.GetCellBias());
1850  layer->m_QuantizedLstmParameters.m_OutputGateBias =
1851  std::make_unique<ScopedCpuTensorHandle>(params.GetOutputGateBias());
1852 
1853  return layer;
1854 }

◆ 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 1719 of file Network.cpp.

Referenced by Network::GetGraph().

1720 {
1721  return m_Graph->AddLayer<QuantizeLayer>(name);
1722 }

◆ AddRankLayer()

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

Adds a rank layer to the network.

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

Implements INetwork.

Definition at line 1483 of file Network.cpp.

Referenced by Network::GetGraph().

1484 {
1485  return m_Graph->AddLayer<RankLayer>(name);
1486 }

◆ 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 1535 of file Network.cpp.

Referenced by Network::GetGraph().

1537 {
1538  return m_Graph->AddLayer<ReshapeLayer>(reshapeDescriptor, name);
1539 }

◆ 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 1488 of file Network.cpp.

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

Referenced by Network::GetGraph().

1490 {
1491  ResizeDescriptor resizeDescriptor;
1492  resizeDescriptor.m_Method = ResizeMethod::Bilinear;
1493  resizeDescriptor.m_DataLayout = descriptor.m_DataLayout;
1494  resizeDescriptor.m_TargetWidth = descriptor.m_TargetWidth;
1495  resizeDescriptor.m_TargetHeight = descriptor.m_TargetHeight;
1496  resizeDescriptor.m_AlignCorners = descriptor.m_AlignCorners;
1497  resizeDescriptor.m_HalfPixelCenters = descriptor.m_HalfPixelCenters;
1498 
1499  return m_Graph->AddLayer<ResizeLayer>(resizeDescriptor, name);
1500 }

◆ 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 1502 of file Network.cpp.

Referenced by Network::GetGraph().

1504 {
1505  return m_Graph->AddLayer<ResizeLayer>(resizeDescriptor, name);
1506 }

◆ AddRsqrtLayer()

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

Add Reciprocal of square root layer to the network.

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

Implements INetwork.

Definition at line 1745 of file Network.cpp.

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

Referenced by Network::GetGraph().

1746 {
1747  return AddElementwiseUnaryLayer(ElementwiseUnaryDescriptor(UnaryOperation::Rsqrt), name);
1748 }
IConnectableLayer * AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor &elementwiseUnaryDescriptor, const char *name=nullptr) override
Add an ElementwiseUnary layer to the network.
Definition: Network.cpp:1203

◆ 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 1413 of file Network.cpp.

Referenced by Network::GetGraph().

1414 {
1415  return m_Graph->AddLayer<SliceLayer>(sliceDescriptor, name);
1416 }

◆ 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 1418 of file Network.cpp.

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

1420 {
1421  return m_Graph->AddLayer<SoftmaxLayer>(softmaxDescriptor, name);
1422 }

◆ 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 1541 of file Network.cpp.

Referenced by Network::GetGraph().

1543 {
1544  return m_Graph->AddLayer<SpaceToBatchNdLayer>(spaceToBatchNdDescriptor, name);
1545 }

◆ 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 1547 of file Network.cpp.

Referenced by Network::GetGraph().

1549 {
1550  return m_Graph->AddLayer<SpaceToDepthLayer>(spaceToDepthDescriptor, name);
1551 }

◆ 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 1424 of file Network.cpp.

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

1426 {
1427  return m_Graph->AddLayer<SplitterLayer>(splitterDescriptor, name);
1428 }

◆ 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 1805 of file Network.cpp.

Referenced by Network::GetGraph().

1807 {
1808  return m_Graph->AddLayer<StackLayer>(stackDescriptor, name);
1809 }

◆ 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 1812 of file Network.cpp.

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

1814 {
1815  return m_Graph->AddLayer<StandInLayer>(desc, name);
1816 }

◆ 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 1729 of file Network.cpp.

Referenced by Network::GetGraph().

1731 {
1732  return m_Graph->AddLayer<StridedSliceLayer>(stridedSliceDescriptor, name);
1733 }

◆ 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 1704 of file Network.cpp.

Referenced by Network::GetGraph().

1705 {
1706  return m_Graph->AddLayer<SubtractionLayer>(name);
1707 }

◆ 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 1767 of file Network.cpp.

Referenced by Network::GetGraph().

1768 {
1769  return m_Graph->AddLayer<SwitchLayer>(name);
1770 }

◆ 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 1777 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::GetGraph().

1781 {
1782  if (descriptor.m_BiasEnabled && !biases.has_value())
1783  {
1784  throw InvalidArgumentException("AddTransposeConvolution2dLayer: Biases cannot be empty");
1785  }
1786 
1787  const auto layer = m_Graph->AddLayer<TransposeConvolution2dLayer>(descriptor, name);
1788 
1789  layer->m_Weight = std::make_unique<ScopedCpuTensorHandle>(weights);
1790 
1791  if (descriptor.m_BiasEnabled)
1792  {
1793  layer->m_Bias = std::make_unique<ScopedCpuTensorHandle>(biases.value());
1794  }
1795 
1796  return layer;
1797 }

◆ AddTransposeLayer()

IConnectableLayer * AddTransposeLayer ( const TransposeDescriptor transposeDescriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a transpose layer to the network.

Parameters
transposeDescriptor- TransposeDescriptor to configure the transpose.
name- Optional name for the layer.
Returns
- Interface for configuring the layer.

Implements INetwork.

Definition at line 1799 of file Network.cpp.

Referenced by Network::GetGraph().

1801 {
1802  return m_Graph->AddLayer<TransposeLayer>(transposeDescriptor, name);
1803 }

◆ GetGraph()

const Graph& GetGraph ( ) const
inline

Definition at line 34 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::AddFillLayer(), 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::AddQLstmLayer(), Network::AddQuantizedLstmLayer(), Network::AddQuantizeLayer(), Network::AddRankLayer(), 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(), Network::AddTransposeLayer(), anchors(), ARMNN_DEPRECATED_MSG, and Network::PrintGraph().

Referenced by Network::Accept(), BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), armnn::GetInputTensorInfo(), and armnn::Optimize().

34 { return *m_Graph; }

◆ PrintGraph()

Status PrintGraph ( )
overridevirtual

Implements INetwork.

Definition at line 1180 of file Network.cpp.

References armnn::Success.

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

1181 {
1182  m_Graph->Print();
1183  return Status::Success;
1184 }

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