Operators#
Operator base class#
Operator
is Aidge’s base class for describing a mathematical Operator. It does not make any assumption on the data coding.
- class aidge_core.Operator#
- __init__(*args, **kwargs)#
- associate_input(self: aidge_core.aidge_core.Operator, inputIdx: int, data: aidge_core.aidge_core.Data) None #
- backend(self: aidge_core.aidge_core.Operator) str #
- forward(self: aidge_core.aidge_core.Operator) None #
- get_impl(self: aidge_core.aidge_core.Operator) aidge_core.aidge_core.OperatorImpl #
- get_raw_input(self: aidge_core.aidge_core.Operator, inputIdx: int) aidge_core.aidge_core.Data #
- get_raw_output(self: aidge_core.aidge_core.Operator, outputIdx: int) aidge_core.aidge_core.Data #
- input_category(self: aidge_core.aidge_core.Operator, idx: int) aidge_core.aidge_core.InputCategory #
Category of a specific input (Data or Param, optional or not). Data inputs exclude inputs expecting parameters (weights or bias).
- Return type:
InputCategory
- is_atomic(self: aidge_core.aidge_core.Operator) bool #
- is_back_edge(self: aidge_core.aidge_core.Operator, input_index: int) bool #
- nb_inputs(self: aidge_core.aidge_core.Operator) int #
- nb_outputs(self: aidge_core.aidge_core.Operator) int #
- set_back_edges(self: aidge_core.aidge_core.Operator, input_indexes: Set[int]) None #
- set_backend(*args, **kwargs)#
Overloaded function.
set_backend(self: aidge_core.aidge_core.Operator, name: str, device: int = 0) -> None
set_backend(self: aidge_core.aidge_core.Operator, backends: List[Tuple[str, int]]) -> None
- set_datatype(self: aidge_core.aidge_core.Operator, dataType: aidge_core.aidge_core.dtype) None #
- set_impl(self: aidge_core.aidge_core.Operator, implementation: aidge_core.aidge_core.OperatorImpl) None #
- set_input(*args, **kwargs)#
Overloaded function.
set_input(self: aidge_core.aidge_core.Operator, inputIdx: int, data: aidge_core.aidge_core.Data) -> None
set_input(self: aidge_core.aidge_core.Operator, inputIdx: int, data: aidge_core.aidge_core.Data) -> None
- set_output(self: aidge_core.aidge_core.Operator, outputIdx: int, data: aidge_core.aidge_core.Data) None #
- type(self: aidge_core.aidge_core.Operator) str #
-
class Operator : public std::enable_shared_from_this<Operator>#
Subclassed by Aidge::OperatorTensor
Public Functions
-
Operator() = delete#
-
inline Operator(const std::string &type, const std::vector<InputCategory> &inputsCategory, const IOIndex_t nbOut, const OperatorType operatorType = OperatorType::Data)#
-
virtual ~Operator() noexcept#
-
inline virtual std::shared_ptr<Attributes> attributes() const#
-
inline virtual std::shared_ptr<DynamicAttributes> inheritedAttributes() const#
Set the specified input with a shallow copy.
- Parameters:
inputIdx – Index of the input to set.
data – Data to copy.
-
virtual void resetInput(const IOIndex_t inputIdx) = 0#
Set the specified input value by performing a deep copy of the given data. The pointer itself is not changed, thus keeping the current connections.
- Parameters:
inputIdx – Index of the input to set.
data – Data to copy.
-
virtual std::shared_ptr<Data> getRawInput(const IOIndex_t inputIdx) const = 0#
Set the specified output value by performing a deep copy of the given data. The pointer itself is not changed, thus keeping the current connections.
- Parameters:
inputIdx – Index of the input to set.
-
virtual std::shared_ptr<Data> getRawOutput(const IOIndex_t outputIdx) const = 0#
-
inline virtual std::string backend() const noexcept#
-
virtual void setBackend(const std::string &name, DeviceIdx_t device = 0) = 0#
-
void setBackend(const std::vector<std::pair<std::string, DeviceIdx_t>> &backends)#
-
virtual void setDataType(const DataType &dataType) const = 0#
-
virtual void setDataFormat(const DataFormat &dataFormat) const = 0#
-
virtual std::set<std::string> getAvailableBackends() const = 0#
Set a new OperatorImpl to the Operator.
-
inline std::shared_ptr<OperatorImpl> getImpl() const noexcept#
Get the OperatorImpl of the Operator.
-
virtual Elts_t getNbRequiredData(const IOIndex_t inputIdx) const#
Minimum amount of data from a specific input for one computation pass.
- Parameters:
inputIdx – Index of the input analyzed.
- Returns:
Elts_t
-
virtual Elts_t getNbRequiredProtected(const IOIndex_t inputIdx) const#
-
virtual Elts_t getRequiredMemory(const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const#
-
virtual Elts_t getNbConsumedData(const IOIndex_t inputIdx) const#
Total amount of consumed data from a specific input.
- Parameters:
inputIdx – Index of the input analyzed.
- Returns:
Elts_t
-
virtual Elts_t getNbProducedData(const IOIndex_t outputIdx) const#
Total amount of produced data ready to be used on a specific output.
- Parameters:
outputIdx – Index of the output analyzed.
- Returns:
Elts_t
-
virtual void updateConsummerProducer()#
-
virtual void resetConsummerProducer()#
-
virtual void forward()#
-
virtual void backward()#
-
inline std::string type() const noexcept#
-
inline OperatorType operatorType() const noexcept#
-
inline InputCategory inputCategory(IOIndex_t idx) const#
-
inline virtual bool isAtomic() const noexcept#
-
inline IOIndex_t nbInputs() const noexcept#
-
inline IOIndex_t nbOutputs() const noexcept#
-
inline void setBackEdges(const std::set<IOIndex_t> &backEdges)#
Set the back edge input indexes for recurting operators. Any recurring operators should specify it’s back edges, otherwise the interpretation of the data flow graph may not be possible.
-
inline bool isBackEdge(IOIndex_t inputIdx) const#
Returns whether the given input index is a back edge.
- Returns:
true if the input index is in the back edge set
-
Operator() = delete#
OperatorTensor base class#
OperatorTensor
derives from the Operator
base class and is the base class for any tensor-based operator.
- class aidge_core.OperatorTensor#
- __init__(*args, **kwargs)#
- associate_input(self: aidge_core.aidge_core.Operator, inputIdx: int, data: aidge_core.aidge_core.Data) None #
- backend(self: aidge_core.aidge_core.Operator) str #
- dims_forwarded(self: aidge_core.aidge_core.OperatorTensor) bool #
- forward(self: aidge_core.aidge_core.Operator) None #
- forward_dims(self: aidge_core.aidge_core.OperatorTensor, allow_data_dependency: bool = False) bool #
- get_impl(self: aidge_core.aidge_core.Operator) aidge_core.aidge_core.OperatorImpl #
- get_input(self: aidge_core.aidge_core.OperatorTensor, inputIdx: int) aidge_core.aidge_core.Tensor #
- get_output(self: aidge_core.aidge_core.OperatorTensor, outputIdx: int) aidge_core.aidge_core.Tensor #
- get_raw_input(self: aidge_core.aidge_core.Operator, inputIdx: int) aidge_core.aidge_core.Data #
- get_raw_output(self: aidge_core.aidge_core.Operator, outputIdx: int) aidge_core.aidge_core.Data #
- input_category(self: aidge_core.aidge_core.Operator, idx: int) aidge_core.aidge_core.InputCategory #
Category of a specific input (Data or Param, optional or not). Data inputs exclude inputs expecting parameters (weights or bias).
- Return type:
InputCategory
- is_atomic(self: aidge_core.aidge_core.Operator) bool #
- is_back_edge(self: aidge_core.aidge_core.Operator, input_index: int) bool #
- nb_inputs(self: aidge_core.aidge_core.Operator) int #
- nb_outputs(self: aidge_core.aidge_core.Operator) int #
- set_back_edges(self: aidge_core.aidge_core.Operator, input_indexes: Set[int]) None #
- set_backend(*args, **kwargs)#
Overloaded function.
set_backend(self: aidge_core.aidge_core.Operator, name: str, device: int = 0) -> None
set_backend(self: aidge_core.aidge_core.Operator, backends: List[Tuple[str, int]]) -> None
- set_datatype(self: aidge_core.aidge_core.Operator, dataType: aidge_core.aidge_core.dtype) None #
- set_impl(self: aidge_core.aidge_core.Operator, implementation: aidge_core.aidge_core.OperatorImpl) None #
- set_input(self: aidge_core.aidge_core.OperatorTensor, outputIdx: int, data: aidge_core.aidge_core.Data) None #
- set_output(self: aidge_core.aidge_core.OperatorTensor, outputIdx: int, data: aidge_core.aidge_core.Data) None #
- type(self: aidge_core.aidge_core.Operator) str #
-
class OperatorTensor : public Aidge::Operator#
Subclassed by Aidge::Abs_Op, Aidge::Add_Op, Aidge::And_Op, Aidge::ArgMax_Op, Aidge::Atan_Op, Aidge::AvgPooling_Op< DIM >, Aidge::BatchNorm_Op< DIM >, Aidge::BitShift_Op, Aidge::Cast_Op, Aidge::Clip_Op, Aidge::Concat_Op, Aidge::ConstantOfShape_Op, Aidge::ConvDepthWise_Op< DIM >, Aidge::Conv_Op< DIM >, Aidge::DepthToSpace_Op, Aidge::Div_Op, Aidge::Erf_Op, Aidge::FC_Op, Aidge::Fold_Op< DIM >, Aidge::Gather_Op, Aidge::GenericOperator_Op, Aidge::GlobalAveragePooling_Op, Aidge::GridSample_Op, Aidge::Heaviside_Op, Aidge::ILayerNorm_Op, Aidge::Identity_Op, Aidge::LRN_Op, Aidge::LeakyReLU_Op, Aidge::Ln_Op, Aidge::MatMul_Op, Aidge::MaxPooling_Op< DIM >, Aidge::Memorize_Op, Aidge::MetaOperator_Op, Aidge::Move_Op, Aidge::Mul_Op, Aidge::Pad_Op< DIM >, Aidge::Pop_Op, Aidge::Pow_Op, Aidge::Producer_Op, Aidge::ReLU_Op, Aidge::ReduceMean_Op, Aidge::ReduceSum_Op, Aidge::Reshape_Op, Aidge::Resize_Op, Aidge::Round_Op, Aidge::Scaling_Op, Aidge::Shape_Op, Aidge::ShiftGELU_Op, Aidge::ShiftMax_Op, Aidge::Sigmoid_Op, Aidge::Slice_Op, Aidge::Softmax_Op, Aidge::Split_Op, Aidge::Sqrt_Op, Aidge::Squeeze_Op, Aidge::StackOp, Aidge::Sub_Op, Aidge::Tanh_Op, Aidge::Transpose_Op, Aidge::Unfold_Op< DIM >, Aidge::Unsqueeze_Op
Public Functions
-
OperatorTensor() = delete#
-
OperatorTensor(const std::string &type, const std::vector<InputCategory> &inputsCategory, const IOIndex_t nbOut)#
Operator tensor constructor. This function is not meant to be called directly but by a derived class constructor every operator class derive from this class.
- Parameters:
type – [in] : type of operator (i.e. “Add”, “AveragePool”,…)
inputsCategory – [in] : describes the type of each input.
nbOut – [in] : Number of tensors this operator will output
-
OperatorTensor(const OperatorTensor &other)#
-
~OperatorTensor()#
Set the specified input with a shallow copy.
- Parameters:
inputIdx – Index of the input to set.
data – Data to copy.
-
virtual void resetInput(const IOIndex_t inputIdx) final override#
Set the specified input value by performing a deep copy of the given data. The pointer itself is not changed, thus keeping the current connections.
- Parameters:
inputIdx – Index of the input to set.
data – Data to copy.
-
virtual std::shared_ptr<Data> getRawInput(const IOIndex_t inputIdx) const final override#
Set the specified output value by performing a deep copy of the given data. The pointer itself is not changed, thus keeping the current connections.
- Parameters:
inputIdx – Index of the input to set.
-
virtual std::shared_ptr<Aidge::Data> getRawOutput(const Aidge::IOIndex_t outputIdx) const final override#
-
virtual std::vector<std::pair<std::vector<Aidge::DimSize_t>, std::vector<DimSize_t>>> computeReceptiveField(const std::vector<DimSize_t> &firstEltDims, const std::vector<DimSize_t> &outputDims, const IOIndex_t outputIdx = 0) const#
For a given output feature area, compute the associated receptive field for each data input.
- Parameters:
firstIdx – First index of the output feature.
outputDims – Size of output feature.
outputIdx – Index of the output. Default 0.
- Returns:
std::vector<std::pair<std::size_t, std::vector<DimSize_t>>> For each dataInput Tensor of the Operator, the first index and dimensions of the feature area.
-
virtual bool forwardDims(bool allowDataDependency = false)#
Will compute the dimensions of operator’s output tensor given the input sizes If the output dimensions cannot be computed because it depends on some undefined inputs then forwardDims will return false and enter in TOKEN mode for subsequent tensors.
TOKEN mode means that forwarddims will only ensure that all inputs and outputs of the graph the node is within are connected.
- Parameters:
allowDataDependency – [in] if set to true, this means that this operator output dimensions depends on the dimensions of optional parameter tensors.
- Returns:
true if dims have been properly forwarded. false otherwise. If set to false, then forwardDims will enter in token mode.
-
virtual bool dimsForwarded() const#
-
virtual void setDataType(const DataType &dataType) const override#
-
virtual void setDataFormat(const DataFormat &dataFormat) const override#
-
virtual void forward() override#
-
OperatorTensor() = delete#
Generic Operator#
A generic tensor-based operator can be used to model any kind of mathematical operator that takes a defined number of inputs, produces a defined number of outputs and can have some attributes. It is possible to provide a function that produces the output tensors size w.r.t. the inputs size. It has a default consumer-producer model (require and consume all inputs full tensors and produces output full tensors).
This is the default operator used for unsupported ONNX operators when loading an ONNX model. While it obviously cannot be executed, a generic operator has still some usefulness:
It allows loading any graph even with unknown operators. It is possible to identify exactly all the missing operator types and their position in the graph;
It can be searched and manipuled with graph matching, allowing for example to replace it with alternative operators;
It can be scheduled and included in the graph static scheduling;
🚧 A custom implementation may be provided in the future, even in pure Python, for rapid integration and prototyping.
- aidge_core.GenericOperator(type: str, nb_data: int, nb_param: int, nb_out: int, name: str = '', **kwargs) aidge_core.aidge_core.Node #
Warning
doxygenfunction: Unable to resolve function “Aidge::GenericOperator” with arguments None in doxygen xml output for project “aidge” from directory: xml/. Potential matches:
- std::shared_ptr<Node> GenericOperator(const std::string &type, IOIndex_t nbData, IOIndex_t nbParam, IOIndex_t nbOut, const std::string &name = "")
- std::shared_ptr<Node> GenericOperator(const std::string &type, const std::vector<InputCategory> &inputCategory, IOIndex_t nbOut, const std::string &name = "")
Meta Operator#
A meta-operator (or composite operator) is internally built from a sub-graph.
- aidge_core.meta_operator(type: str, graph: aidge_core.aidge_core.GraphView, forced_inputs_category: List[aidge_core.aidge_core.InputCategory] = [], name: str = '') aidge_core.aidge_core.Node #
Building a new meta-operator is simple:
auto graph = Sequential({
Pad<2>(padding_dims, (!name.empty()) ? name + "_pad" : ""),
MaxPooling(kernel_dims, (!name.empty()) ? name + "_maxpooling" : "", stride_dims, ceil_mode)
});
return MetaOperator("PaddedMaxPooling2D", graph, name);
You can use the Expand meta operators recipe to flatten the meta-operators in a graph.
Predefined operators#
Add#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>AddOp</b> "):::operator In0[data_input_0]:::text-only -->|"In[0]"| Op In1[data_input_n]:::text-only -->|"In[1]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.Add(name: str = '') aidge_core.aidge_core.Node #
Average Pooling#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>AvgPooling2DOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.AvgPooling1D(kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1]) aidge_core.aidge_core.Node #
- aidge_core.AvgPooling2D(kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1]) aidge_core.aidge_core.Node #
- aidge_core.AvgPooling3D(kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1, 1]) aidge_core.aidge_core.Node #
BatchNorm#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>BatchNorm2DOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op In1[scale]:::text-only -->|"In[1]"| Op In2[shift]:::text-only -->|"In[2]"| Op In3[mean]:::text-only -->|"In[3]"| Op In4[variance]:::text-only -->|"In[4]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.BatchNorm2D(nb_features: int, epsilon: float = 9.999999747378752e-06, momentum: float = 0.10000000149011612, training_mode: bool = False, name: str = '') aidge_core.aidge_core.Node #
Cast#
Concat#
- aidge_core.Concat(nb_inputs: int, axis: int, name: str = '') aidge_core.aidge_core.Node #
Conv#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>Conv2DOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op In1[weight]:::text-only -->|"In[1]"| Op In2[bias]:::text-only -->|"In[2]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.Conv1D(in_channels: int, out_channels: int, kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1], dilation_dims: List[int] = [1], no_bias: bool = False) aidge_core.aidge_core.Node #
- aidge_core.Conv2D(in_channels: int, out_channels: int, kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1], dilation_dims: List[int] = [1, 1], no_bias: bool = False) aidge_core.aidge_core.Node #
ConvDepthWise#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>ConvDepthWise2DOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op In1[weight]:::text-only -->|"In[1]"| Op In2[bias]:::text-only -->|"In[2]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.ConvDepthWise1D(nb_channenls: int, kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1], dilation_dims: List[int] = [1], no_bias: bool = False) aidge_core.aidge_core.Node #
- aidge_core.ConvDepthWise2D(nb_channenls: int, kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1], dilation_dims: List[int] = [1, 1], no_bias: bool = False) aidge_core.aidge_core.Node #
Div#
- aidge_core.Div(name: str = '') aidge_core.aidge_core.Node #
Erf#
- aidge_core.Erf(name: str = '') aidge_core.aidge_core.Node #
FC#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>FCOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op In1[weight]:::text-only -->|"In[1]"| Op In2[bias]:::text-only -->|"In[2]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.FC(in_channels: int, out_channels: int, no_bias: bool = False, name: str = '') aidge_core.aidge_core.Node #
Gather#
- aidge_core.Gather(axis: int = 0, indices: List[int] = [], gathered_shape: List[int] = [], name: str = '') aidge_core.aidge_core.Node #
Identity#
- aidge_core.Identity(name: str = '') aidge_core.aidge_core.Node #
LeakyReLU#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>LeakyReLUOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.LeakyReLU(negative_slope: float = 0.0, name: str = '') aidge_core.aidge_core.Node #
MatMul#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>MatMulOp</b> "):::operator In0[data_input1]:::text-only -->|"In[0]"| Op In1[data_input2]:::text-only -->|"In[1]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.MatMul(name: str = '') aidge_core.aidge_core.Node #
Memorize#
Move#
Mul#
- aidge_core.Mul(name: str = '') aidge_core.aidge_core.Node #
Pad#
Not available yet !
Warning
doxygenfunction: Unable to resolve function “Aidge::Pad” with arguments (const std::array<DimSize_t, 2 * DIM>&, const std::string&, const PadBorderType&, double) in doxygen xml output for project “aidge” from directory: xml/. Potential matches:
- template<DimSize_t DIM> std::shared_ptr<Node> Pad(DimSize_t const (&beginEndTuples)[2 * DIM], const std::string &name = "", PadBorderType borderType = PadBorderType::Constant, double borderValue = 0.0)
- template<std::array<DimSize_t, 1>::size_type DIM> std::shared_ptr<Node> Pad(const std::array<DimSize_t, 2 * DIM> &beginEndTuples, const std::string &name = "", PadBorderType borderType = PadBorderType::Constant, double borderValue = 0.0)
Pop#
- aidge_core.Pop(name: str = '') aidge_core.aidge_core.Node #
Pow#
- aidge_core.Pow(name: str = '') aidge_core.aidge_core.Node #
Producer#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>ProducerOp</b> "):::operator Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.Producer(*args, **kwargs)#
Overloaded function.
Producer(tensor: aidge_core.aidge_core.Tensor, name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
Producer(dims: List[int[1]], name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
Producer(dims: List[int[2]], name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
Producer(dims: List[int[3]], name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
Producer(dims: List[int[4]], name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
Producer(dims: List[int[5]], name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
Producer(dims: List[int[6]], name: str = ‘’, constant: bool = False) -> aidge_core.aidge_core.Node
ReduceMean#
- aidge_core.ReduceMean(axes: List[int] = [], keep_dims: bool = True, noop_with_empty_axes: bool = False, name: str = '') aidge_core.aidge_core.Node #
- Initialize a node containing a ReduceMean operator.
- param axes:
Axes along which to do the reduction. The accepted range is [-r, r-1], where r is the rank of the input tensor.
- type axes:
List[int]
- param keepdims:
If True (default), retains the reduced dimensions with size 1. If False, the reduced dimensions are removed.
- type keepdims:
bool
- param noop_with_empty_axes:
If True, the operator just copies the input,
- if False, the operatpr reduces all the dimensions.
- type noop_with_empty_axes:
bool
:param name : name of the node.
ReLU#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>ReLUOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.ReLU(name: str = '') aidge_core.aidge_core.Node #
Reshape#
- aidge_core.Reshape(shape: List[int] = [], allowzero: bool = False, name: str = '') aidge_core.aidge_core.Node #
Scaling#
Sigmoid#
- aidge_core.Sigmoid(name: str = '') aidge_core.aidge_core.Node #
Slice#
- aidge_core.Slice(starts: List[int] = [], ends: List[int] = [], axes: List[int] = [], steps: List[int] = [], name: str = '') aidge_core.aidge_core.Node #
Softmax#
%%{init: {'flowchart': { 'curve': 'monotoneY'}, 'fontFamily': 'Verdana' } }%% graph TD Op("<b>SoftmaxOp</b> "):::operator In0[data_input]:::text-only -->|"In[0]"| Op Op -->|"Out[0]"| Out0[data_output]:::text-only classDef text-only fill-opacity:0, stroke-opacity:0; classDef operator stroke-opacity:0;
- aidge_core.Softmax(axis: int, name: str = '') aidge_core.aidge_core.Node #
Sqrt#
- aidge_core.Sqrt(name: str = '') aidge_core.aidge_core.Node #
Sub#
- aidge_core.Sub(name: str = '') aidge_core.aidge_core.Node #
Tanh#
- aidge_core.Tanh(name: str = '') aidge_core.aidge_core.Node #
Transpose#
- aidge_core.Transpose(output_dims_order: List[int] = [], name: str = '') aidge_core.aidge_core.Node #
- Initialize a node containing a transpose operator.
- :param output_dims_orderaxes permutation order, must be of rank = r and values between [0;r-1]
with r = input_tensor.nbDims()
:type output_dims_order : :py:class: List[Int]
:param name : name of the node.
Predefined meta-operators#
Some meta-operators (or composite operators) are predefined for conveniance and/or for compatibility with others frameworks.
PaddedConv#
- aidge_core.PaddedConv2D(in_channels: int, out_channels: int, kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1], padding_dims: List[int] = [0, 0, 0, 0], dilation_dims: List[int] = [1, 1], no_bias: bool = False) aidge_core.aidge_core.Node #
PaddedConvDepthWise#
- aidge_core.PaddedConvDepthWise2D(nb_channels: int, kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1], padding_dims: List[int] = [0, 0, 0, 0], dilation_dims: List[int] = [1, 1], no_bias: bool = False) aidge_core.aidge_core.Node #
PaddedAvgPooling#
- aidge_core.PaddedAvgPooling2D(kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1], padding_dims: List[int] = [0, 0, 0, 0]) aidge_core.aidge_core.Node #
PaddedMaxPooling#
- aidge_core.PaddedMaxPooling2D(kernel_dims: List[int], name: str = '', stride_dims: List[int] = [1, 1], padding_dims: List[int] = [0, 0, 0, 0], ceil_mode: bool = False) aidge_core.aidge_core.Node #
LSTM#
- aidge_core.LSTM(in_channels: int, hidden_channels: int, seq_length: int, nobias: bool = False, name: str = '') aidge_core.aidge_core.Node #