ArmNN
 20.11
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...
 
IConnectableLayerAddLogicalBinaryLayer (const LogicalBinaryDescriptor &logicalBinaryDescriptor, const char *name=nullptr) override
 Adds a Logical Binary 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 1177 of file Network.cpp.

1178 : m_NetworkOptions(networkOptions),
1179  m_Graph(std::make_unique<Graph>(GetShapeInferenceMethod()))
1180 {}

◆ ~Network()

~Network ( )

Definition at line 1182 of file Network.cpp.

1183 {
1184 }

Member Function Documentation

◆ Accept()

void Accept ( ILayerVisitor visitor) const
overridevirtual

Implements INetwork.

Definition at line 2010 of file Network.cpp.

References Network::GetGraph().

Referenced by Network::GetGraph().

2011 {
2012  for (auto layer : GetGraph())
2013  {
2014  layer->Accept(visitor);
2015  };
2016 }
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 1452 of file Network.cpp.

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

Referenced by Network::GetGraph().

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

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

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

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

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

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

1458 {
1459  return m_Graph->AddLayer<AdditionLayer>(name);
1460 }

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

Referenced by Network::GetGraph().

1408 {
1409  return m_Graph->AddLayer<ArgMinMaxLayer>(argMinMaxDescriptor, name);
1410 }

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

References BatchNormalizationLayer::m_Mean.

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

1478 {
1479  const auto layer = m_Graph->AddLayer<BatchNormalizationLayer>(desc, name);
1480 
1481  layer->m_Mean = std::make_unique<ScopedCpuTensorHandle>(mean);
1482  layer->m_Variance = std::make_unique<ScopedCpuTensorHandle>(variance);
1483  layer->m_Beta = std::make_unique<ScopedCpuTensorHandle>(beta);
1484  layer->m_Gamma = std::make_unique<ScopedCpuTensorHandle>(gamma);
1485 
1486  return layer;
1487 }

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

Referenced by Network::GetGraph().

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

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

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

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

◆ 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 1268 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().

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

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

References ConstantLayer::m_LayerOutput.

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

1533 {
1534  auto layer = m_Graph->AddLayer<ConstantLayer>(name);
1535 
1536  layer->m_LayerOutput = std::make_unique<ScopedCpuTensorHandle>(input);
1537 
1538  return layer;
1539 }

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

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

1300 {
1301  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1302 }

◆ AddConvolution2dLayer() [2/3]

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

Implements INetwork.

Definition at line 1304 of file Network.cpp.

1307 {
1308  Optional<ConstTensor> biases;
1309  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1310 }

◆ AddConvolution2dLayer() [3/3]

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

Implements INetwork.

Definition at line 1312 of file Network.cpp.

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

1316 {
1317  Optional<ConstTensor> optionalBiases(biases);
1318  return AddConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name);
1319 }

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

Referenced by Network::GetGraph().

1346 {
1347  return m_Graph->AddLayer<DepthToSpaceLayer>(depthToSpaceDescriptor, name);
1348 }

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

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

1355 {
1356  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1357 }

◆ AddDepthwiseConvolution2dLayer() [2/3]

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

Implements INetwork.

Definition at line 1359 of file Network.cpp.

1363 {
1364  Optional<ConstTensor> biases;
1365  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, biases, name);
1366 }

◆ AddDepthwiseConvolution2dLayer() [3/3]

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

Implements INetwork.

Definition at line 1368 of file Network.cpp.

1373 {
1374  Optional<ConstTensor> optionalBiases(biases);
1375  return AddDepthwiseConvolution2dLayerImpl(convolution2dDescriptor, weights, optionalBiases, name);
1376 }

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

Referenced by Network::GetGraph().

1731 {
1732  return m_Graph->AddLayer<DequantizeLayer>(name);
1733 }

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

References anchors(), and DetectionPostProcessLayer::m_Anchors.

Referenced by Network::GetGraph().

1380 {
1381  const auto layer = m_Graph->AddLayer<DetectionPostProcessLayer>(descriptor, name);
1382 
1383  layer->m_Anchors = std::make_unique<ScopedCpuTensorHandle>(anchors);
1384 
1385  return layer;
1386 }
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 1705 of file Network.cpp.

Referenced by Network::GetGraph().

1706 {
1707  return m_Graph->AddLayer<DivisionLayer>(name);
1708 }

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

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

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

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

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

Referenced by Network::GetGraph().

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

◆ 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 1215 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().

1217 {
1218  return m_Graph->AddLayer<FillLayer>(fillDescriptor, name);
1219 }

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

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

1560 {
1561  return m_Graph->AddLayer<FloorLayer>(name);
1562 }

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

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

1247 {
1248  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, biases, name);
1249 }

◆ AddFullyConnectedLayer() [2/3]

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

Implements INetwork.

Definition at line 1251 of file Network.cpp.

1254 {
1255  Optional<ConstTensor> biases;
1256  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, biases, name);
1257 }

◆ AddFullyConnectedLayer() [3/3]

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

Implements INetwork.

Definition at line 1259 of file Network.cpp.

1263 {
1264  Optional<ConstTensor> optionalBiases(biases);
1265  return AddFullyConnectedLayerImpl(fullyConnectedDescriptor, weights, optionalBiases, name);
1266 }

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

Referenced by Network::GetGraph().

1757 {
1758  GatherDescriptor gatherDescriptor{};
1759  return AddGatherLayer(gatherDescriptor, name);
1760 }
IConnectableLayer * AddGatherLayer(const char *name=nullptr) override
Add Gather layer to the network.
Definition: Network.cpp:1756

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

1764 {
1765  return m_Graph->AddLayer<GatherLayer>(gatherDescriptor, name);
1766 }

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

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

Referenced by Network::GetGraph().

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

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

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

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

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

Referenced by Network::GetGraph().

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

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

Referenced by Network::GetGraph().

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

◆ AddLogicalBinaryLayer()

IConnectableLayer * AddLogicalBinaryLayer ( const LogicalBinaryDescriptor descriptor,
const char *  name = nullptr 
)
overridevirtual

Adds a Logical Binary layer to the network.

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

Implements INetwork.

Definition at line 2004 of file Network.cpp.

Referenced by Network::GetGraph().

2006 {
2007  return m_Graph->AddLayer<LogicalBinaryLayer>(logicalBinaryDescriptor, name);
2008 }

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

Referenced by Network::GetGraph().

1528 {
1529  return m_Graph->AddLayer<LogSoftmaxLayer>(desc, name);
1530 }

◆ 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 1564 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().

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

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

Referenced by Network::GetGraph().

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

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

Referenced by Network::GetGraph().

1716 {
1717  return m_Graph->AddLayer<MeanLayer>(meanDescriptor,name);
1718 }

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

Referenced by Network::GetGraph().

1769 {
1770  return m_Graph->AddLayer<MergeLayer>(name);
1771 }

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

References Network::AddConcatLayer().

Referenced by Network::GetGraph().

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

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

Referenced by Network::GetGraph().

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

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

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

1463 {
1464  return m_Graph->AddLayer<MultiplicationLayer>(name);
1465 }

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

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

1415 {
1416  return m_Graph->AddLayer<NormalizationLayer>(normalizationDescriptor, name);
1417 }

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

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

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

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

Referenced by Network::GetGraph().

1721 {
1722  return m_Graph->AddLayer<PadLayer>(padDescriptor,name);
1723 }

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

Referenced by Network::GetGraph().

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

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

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

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

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

Referenced by Network::GetGraph().

1779 {
1780  return m_Graph->AddLayer<PreluLayer>(name);
1781 }

◆ 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 1862 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().

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

◆ 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 1824 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().

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

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

Referenced by Network::GetGraph().

1726 {
1727  return m_Graph->AddLayer<QuantizeLayer>(name);
1728 }

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

Referenced by Network::GetGraph().

1490 {
1491  return m_Graph->AddLayer<RankLayer>(name);
1492 }

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

Referenced by Network::GetGraph().

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

◆ 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 1494 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().

1496 {
1497  ResizeDescriptor resizeDescriptor;
1498  resizeDescriptor.m_Method = ResizeMethod::Bilinear;
1499  resizeDescriptor.m_DataLayout = descriptor.m_DataLayout;
1500  resizeDescriptor.m_TargetWidth = descriptor.m_TargetWidth;
1501  resizeDescriptor.m_TargetHeight = descriptor.m_TargetHeight;
1502  resizeDescriptor.m_AlignCorners = descriptor.m_AlignCorners;
1503  resizeDescriptor.m_HalfPixelCenters = descriptor.m_HalfPixelCenters;
1504 
1505  return m_Graph->AddLayer<ResizeLayer>(resizeDescriptor, name);
1506 }

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

Referenced by Network::GetGraph().

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

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

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

Referenced by Network::GetGraph().

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

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

Referenced by Network::GetGraph().

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

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

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

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

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

Referenced by Network::GetGraph().

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

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

Referenced by Network::GetGraph().

1555 {
1556  return m_Graph->AddLayer<SpaceToDepthLayer>(spaceToDepthDescriptor, name);
1557 }

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

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

1432 {
1433  return m_Graph->AddLayer<SplitterLayer>(splitterDescriptor, name);
1434 }

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

Referenced by Network::GetGraph().

1813 {
1814  return m_Graph->AddLayer<StackLayer>(stackDescriptor, name);
1815 }

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

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

1820 {
1821  return m_Graph->AddLayer<StandInLayer>(desc, name);
1822 }

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

Referenced by Network::GetGraph().

1737 {
1738  return m_Graph->AddLayer<StridedSliceLayer>(stridedSliceDescriptor, name);
1739 }

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

Referenced by Network::GetGraph().

1711 {
1712  return m_Graph->AddLayer<SubtractionLayer>(name);
1713 }

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

Referenced by Network::GetGraph().

1774 {
1775  return m_Graph->AddLayer<SwitchLayer>(name);
1776 }

◆ 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 1783 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().

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

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

Referenced by Network::GetGraph().

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

◆ 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::AddLogicalBinaryLayer(), 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 1186 of file Network.cpp.

References armnn::Success.

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

1187 {
1188  m_Graph->Print();
1189  return Status::Success;
1190 }

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