aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/src/pyarmnn/swig/modules
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyarmnn/src/pyarmnn/swig/modules')
-rw-r--r--python/pyarmnn/src/pyarmnn/swig/modules/armnn_descriptors.i66
-rw-r--r--python/pyarmnn/src/pyarmnn/swig/modules/armnn_network.i58
2 files changed, 104 insertions, 20 deletions
diff --git a/python/pyarmnn/src/pyarmnn/swig/modules/armnn_descriptors.i b/python/pyarmnn/src/pyarmnn/swig/modules/armnn_descriptors.i
index 9a01a52e13..a050722bb9 100644
--- a/python/pyarmnn/src/pyarmnn/swig/modules/armnn_descriptors.i
+++ b/python/pyarmnn/src/pyarmnn/swig/modules/armnn_descriptors.i
@@ -15,6 +15,7 @@ namespace std {
}
%include "typemaps/vectors.i"
+%include "stdint.i"
%typemap(out) const uint32_t*
%{
@@ -388,6 +389,46 @@ struct FakeQuantizationDescriptor
%feature("docstring",
"
+ A descriptor for the Fill layer. Creates a tensor filled with a scalar value.
+
+ Contains:
+ m_Value (float): Value the tensor will be filled with.
+
+ ") FillDescriptor;
+struct FillDescriptor
+{
+ FillDescriptor();
+ FillDescriptor(const float& value);
+
+ bool operator ==(const FillDescriptor& rhs) const;
+
+ float m_Value;
+};
+
+%feature("docstring",
+ "
+ A descriptor for the Gather layer.
+
+ Contains:
+ m_Axis (int32_t): The axis from where to gather values from.
+
+ ") GatherDescriptor;
+struct GatherDescriptor
+{
+ GatherDescriptor();
+
+ GatherDescriptor(int32_t axis);
+
+ bool operator ==(const GatherDescriptor& rhs) const
+ {
+ return m_Axis == rhs.m_Axis;
+ }
+
+ int32_t m_Axis;
+};
+
+%feature("docstring",
+ "
A descriptor for the FullyConnected layer. See `INetwork.AddFullyConnectedLayer()`.
Contains:
@@ -661,7 +702,9 @@ struct ReshapeDescriptor
Default: `ResizeMethod_NearestNeighbor`.
m_DataLayout (int): The data layout to be used (`DataLayout_NCHW`, `DataLayout_NHWC`). Default: `DataLayout_NCHW`.
m_AlignCorners (bool): Align corners or not when resizing. If True, corner pixel values are preserved after resizing.
- Default: False
+ Default: False.
+ m_HalfPixelCenters (bool): If true, calculates the pixels from the center instead of from the edge.
+ Default: False.
") ResizeDescriptor;
struct ResizeDescriptor
@@ -673,6 +716,7 @@ struct ResizeDescriptor
ResizeMethod m_Method;
DataLayout m_DataLayout;
bool m_AlignCorners;
+ bool m_HalfPixelCenters;
bool operator ==(const ResizeDescriptor& rhs) const;
};
@@ -970,20 +1014,24 @@ struct SoftmaxDescriptor
m_StrideY (int): Underlying C++ data type is uint32_t. Stride value when proceeding through input for the height dimension. Default: 0.
m_BiasEnabled (bool): Enable/disable bias. Default: false.
m_DataLayout (int): The data layout to be used (`DataLayout_NCHW`, `DataLayout_NHWC`). Default: `DataLayout_NCHW`.
+ m_OutputShapeEnabled (bool): Set to true if output shape is specified. Will prevent output shape inference.
+ m_OutputShape (list of int): Output shape if it has been specified.
") TransposeConvolution2dDescriptor;
struct TransposeConvolution2dDescriptor
{
TransposeConvolution2dDescriptor();
- uint32_t m_PadLeft;
- uint32_t m_PadRight;
- uint32_t m_PadTop;
- uint32_t m_PadBottom;
- uint32_t m_StrideX;
- uint32_t m_StrideY;
- bool m_BiasEnabled;
- DataLayout m_DataLayout;
+ uint32_t m_PadLeft;
+ uint32_t m_PadRight;
+ uint32_t m_PadTop;
+ uint32_t m_PadBottom;
+ uint32_t m_StrideX;
+ uint32_t m_StrideY;
+ bool m_BiasEnabled;
+ DataLayout m_DataLayout;
+ bool m_OutputShapeEnabled;
+ std::vector<unsigned int> m_OutputShape;
bool operator ==(const TransposeConvolution2dDescriptor& rhs) const;
};
diff --git a/python/pyarmnn/src/pyarmnn/swig/modules/armnn_network.i b/python/pyarmnn/src/pyarmnn/swig/modules/armnn_network.i
index b065331992..4665e6087e 100644
--- a/python/pyarmnn/src/pyarmnn/swig/modules/armnn_network.i
+++ b/python/pyarmnn/src/pyarmnn/swig/modules/armnn_network.i
@@ -20,15 +20,21 @@ Struct for holding options relating to the Arm NN optimizer. See `Optimize`.
Contains:
m_debug (bool): Add debug data for easier troubleshooting.
- m_ReduceFp32ToFp16 (bool): Reduce Fp32 data to Fp16 for faster processing.
+ m_ReduceFp32ToBf16 (bool): Reduces Fp32 network to BFloat16 (Bf16) for faster processing. Layers
+ that can not be reduced will be left in Fp32.
+ m_ReduceFp32ToFp16 (bool): Reduces Fp32 network to Fp16 for faster processing. Layers
+ that can not be reduced will be left in Fp32.
") OptimizerOptions;
struct OptimizerOptions
{
OptimizerOptions();
- OptimizerOptions(bool reduceFp32ToFp16, bool debug);
+ OptimizerOptions(bool reduceFp32ToFp16,
+ bool debug,
+ bool reduceFp32ToBf16 = false);
+ bool m_ReduceFp32ToBf16;
bool m_ReduceFp32ToFp16;
bool m_Debug;
};
@@ -501,21 +507,35 @@ public:
armnn::IConnectableLayer* AddDivisionLayer(const char* name = nullptr);
%feature("docstring",
- "
- Adds an Elementwise Unary layer to the network. Type of unary operation to use is decided by elementwiseUnaryDescriptor. Unary operations supported are (Abs, Exp, Neg, Rsqrt, Sqrt)
+ "
+ Adds an Elementwise Unary layer to the network. Type of unary operation to use is decided by elementwiseUnaryDescriptor. Unary operations supported are (Abs, Exp, Neg, Rsqrt, Sqrt)
- Args:
- elementwiseUnaryDescriptor (ElementwiseUnaryDescriptor): ElementwiseUnaryDescriptor to configure the choice of unary operation added to the network.
- name (str): Optional name for the layer.
+ Args:
+ elementwiseUnaryDescriptor (ElementwiseUnaryDescriptor): ElementwiseUnaryDescriptor to configure the choice of unary operation added to the network.
+ name (str): Optional name for the layer.
- Returns:
- IConnectableLayer: Interface for configuring the layer.
- ") AddElementwiseUnaryLayer;
+ Returns:
+ IConnectableLayer: Interface for configuring the layer.
+ ") AddElementwiseUnaryLayer;
armnn::IConnectableLayer* AddElementwiseUnaryLayer(const ElementwiseUnaryDescriptor& elementwiseUnaryDescriptor,
const char* name = nullptr);
%feature("docstring",
"
+ Add a Fill layer to the network.
+
+ Args:
+ FillDescriptor (FillDescriptor): Descriptor for the fill operation.
+ name (str): Optional name for the layer.
+
+ Returns:
+ IConnectableLayer: Interface for configuring the layer.
+ ") AddFillLayer;
+ armnn::IConnectableLayer* AddFillLayer(const FillDescriptor& fillDescriptor,
+ const char* name = nullptr);
+
+ %feature("docstring",
+ "
Adds a Floor layer to the network.
Args:
@@ -531,12 +551,14 @@ public:
Add Gather layer to the network.
Args:
+ descriptor (GatherDescriptor): Descriptor for the gather operation.
name (str): Optional name for the layer.
Returns:
IConnectableLayer: Interface for configuring the layer.
") AddGatherLayer;
- armnn::IConnectableLayer* AddGatherLayer(const char* name = nullptr);
+ armnn::IConnectableLayer* AddGatherLayer(const GatherDescriptor& descriptor,
+ const char* name = nullptr);
%feature("docstring",
"
@@ -752,6 +774,20 @@ public:
armnn::IConnectableLayer* AddQuantizedLstmLayer(const armnn::QuantizedLstmInputParams& params,
const char* name = nullptr);
+
+ %feature("docstring",
+ "
+ Adds a Rank layer to the network.
+
+ Args:
+ name (str): Optional name for the layer.
+
+ Returns:
+ IConnectableLayer: Interface for configuring the layer.
+ ") AddRankLayer;
+ armnn::IConnectableLayer* AddRankLayer(const char* name = nullptr);
+
+
%feature("docstring",
"
Adds a Reshape layer to the network.