# blaize::onnx::opset13¶

## Functions¶

Name | |
---|---|

vx_node | Abs(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Acos(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Acosh(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Add(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | And(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | ArgMax(vx_graph G, vx_tensor A, vx_tensor Z, int axis =0, int keepdims =1, int select_last_index =0) |

vx_node | ArgMin(vx_graph G, vx_tensor A, vx_tensor Z, int axis =0, int keepdims =1, int select_last_index =0) |

vx_node | Asin(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Asinh(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Atan(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Atanh(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | AveragePool(vx_graph G, vx_tensor A, vx_tensor Z, int ceil_mode =0, const vx::Shape & kernel_shape ={}, const std::vector< uint32_t > & pads ={}, const std::vector< uint32_t > & strides ={}, int count_include_pad =0) |

vx_node | BatchNormalization(vx_graph G, vx_tensor A, vx_tensor S, vx_tensor B, vx_tensor var, vx_tensor mean, vx_tensor Z, float epsilon =0.00001f) |

vx_node | BitShift(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z, ShiftDirection direction) |

vx_node | Ceil(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Clip(vx_graph G, vx_tensor A, vx_tensor Z, float min =1.17549435e-38f, float max =3.38953139e+38f) |

vx_node | Concat(vx_graph G, const std::vector< vx_tensor > & inputs, vx_tensor Z, int axis) |

vx_node | Conv(vx_graph G, vx_tensor A, vx_tensor W, vx_tensor B, vx_tensor Z, const std::vector< uint32_t > & dilations ={}, int group =1, const vx::Shape & kernel_shape ={}, const std::vector< uint32_t > & pads ={}, const std::vector< uint32_t > & strides ={}) |

vx_node | ConvTranspose(vx_graph G, vx_tensor A, vx_tensor W, vx_tensor B, vx_tensor Z, const std::vector< uint32_t > & dilations ={}, int group =1, const vx::Shape & kernel_shape ={}, const std::vector< uint32_t > & output_padding ={}, const std::vector< uint32_t > & pads ={}, const std::vector< uint32_t > & strides ={}) |

vx_node | Cos(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Cosh(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | CumSum(vx_graph G, vx_tensor A, vx_tensor Z, int axis =0, int exclusive =0, int reverse =0) |

vx_node | DepthToSpace(vx_graph G, vx_tensor A, vx_tensor Z, int blocksize, DepthToSpaceMode mode =DepthToSpaceMode::DCR) |

vx_node | Div(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Elu(vx_graph G, vx_tensor A, vx_tensor Z, float alpha =1.0f) |

vx_node | Equal(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Erf(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Exp(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Expand(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Floor(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Gather(vx_graph G, vx_tensor A, vx_tensor Z, vx_tensor indices, int axis =0) |

vx_node | GatherElements(vx_graph G, vx_tensor A, vx_tensor Z, vx_tensor indices, int axis =0) |

vx_node | GatherND(vx_graph G, vx_tensor A, vx_tensor Z, vx_tensor indices, int batch_dims =0) |

vx_node | Gemm(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor C, vx_tensor Z, float alpha =1.0f, float beta =1.0f, int transA =0, int transB =0) |

vx_node | GlobalAveragePool(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | GlobalLpPool(vx_graph G, vx_tensor A, vx_tensor Z, int p =2) |

vx_node | GlobalMaxPool(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Greater(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | HardSigmoid(vx_graph G, vx_tensor A, vx_tensor Z, float alpha =0.2f, float beta =0.5f) |

vx_node | Hardmax(vx_graph G, vx_tensor A, vx_tensor Z, int axis =-1) |

vx_node | Identity(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | InstanceNormalization(vx_graph G, vx_tensor A, vx_tensor Z, vx_tensor S, vx_tensor B, float epsilon =0.00001f) |

vx_node | IsInf(vx_graph G, vx_tensor A, vx_tensor Z, int detect_negative =1, int detect_positive =1) |

vx_node | IsNaN(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | LRN(vx_graph G, vx_tensor A, vx_tensor Z, int size, float alpha =0.0001f, float beta =0.75f, float bias =1.0f) |

vx_node | LeakyRelu(vx_graph G, vx_tensor A, vx_tensor Z, float alpha =1.0f) |

vx_node | Less(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Log(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | LogSoftmax(vx_graph G, vx_tensor A, vx_tensor Z, int axis =-1) |

vx_node | LpNormalization(vx_graph G, vx_tensor A, vx_tensor Z, int p =2, int axis =-1) |

vx_node | LpPool(vx_graph G, vx_tensor A, vx_tensor Z, const vx::Shape & kernel_shape, int p =2, const std::vector< uint32_t > & pads ={}, const std::vector< uint32_t > & strides ={}) |

vx_node | MatMul(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Max(vx_graph G, const std::vector< vx_tensor > & inputs, vx_tensor Z) |

vx_node | MaxPool(vx_graph G, vx_tensor A, vx_tensor Z, int ceil_mode =0, const std::vector< uint32_t > & dilations ={}, const vx::Shape & kernel_shape ={}, const std::vector< uint32_t > & pads ={}, const std::vector< uint32_t > & strides ={}, int storage_order =0) |

vx_node | MaxRoiPool(vx_graph G, vx_tensor A, vx_tensor R, vx_tensor Z, const vx::Shape & pooled_shape) |

vx_node | MaxUnpool(vx_graph G, vx_tensor A, vx_tensor I, vx_tensor Z, const vx::Shape & kernel_shape ={}, const std::vector< uint32_t > & pads ={}, const std::vector< uint32_t > & strides ={}) |

vx_node | Mean(vx_graph G, const std::vector< vx_tensor > & inputs, vx_tensor Z) |

vx_node | Min(vx_graph G, const std::vector< vx_tensor > & inputs, vx_tensor Z) |

vx_node | Mod(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z, int fmod =0) |

vx_node | Mul(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Neg(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | NonMaxSuppression(vx_graph G, vx_tensor boxes, vx_tensor scores, vx_tensor selected_indices, int center_point_box =0, int max_output_boxes_per_class =0, float iou_threshold =0.0f, float score_threshold =0.0f) |

vx_node | Not(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | OneHot(vx_graph G, vx_tensor A, vx_tensor Z, int depth =0, int axis =-1, const std::vector< float > & values ={0.0, 0.0}) |

vx_node | Or(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | PRelu(vx_graph G, vx_tensor A, vx_tensor S, vx_tensor Z) |

vx_node | Pow(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Reciprocal(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | ReduceL1(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceL2(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceLogSum(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceLogSumExp(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceMax(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceMean(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceMin(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceProd(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceSum(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | ReduceSumSquare(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}, int keepdims =1) |

vx_node | Relu(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Reshape(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Resize(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< float > & scales ={}, vx_tensor roi =nullptr, InterpolationMode mode =InterpolationMode::NEAREST, CoordinateTransformationMode coordinate_transformation_mode =CoordinateTransformationMode::HALF_PIXEL, NearestMode nearest_mode =NearestMode::ROUND_PREFER_FLOOR, int exclude_outside =0, float extrapolation_value =0.0f, float cubic_coeff_a =-0.75f) |

vx_node | RoiAlign(vx_graph G, vx_tensor A, vx_tensor R, vx_tensor Z, RoiAlignMode mode =RoiAlignMode::AVG, int output_height =1, int output_width =1, int sampling_ratio =0, float spatial_scale_factor =1.0f) |

vx_node | Round(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | ScatterElements(vx_graph G, vx_tensor A, vx_tensor updates, vx_tensor Z, vx_tensor indices, int axis =0) |

vx_node | ScatterND(vx_graph G, vx_tensor A, vx_tensor updates, vx_tensor Z, vx_tensor indices) |

vx_node | Selu(vx_graph G, vx_tensor A, vx_tensor Z, float alpha =1.67326f, float gamma =1.0507f) |

vx_node | Shrink(vx_graph G, vx_tensor A, vx_tensor Z, float bias =0.0f, float lambd =0.5f) |

vx_node | Sigmoid(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Sign(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Sin(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Sinh(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Slice(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & starts, const std::vector< int > & ends, const std::vector< int > & axes ={}, const std::vector< int > & steps ={}) |

vx_node | Softmax(vx_graph G, vx_tensor A, vx_tensor Z, int axis =-1) |

vx_node | Softplus(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Softsign(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | SpaceToDepth(vx_graph G, vx_tensor A, vx_tensor Z, int blocksize) |

vx_node | Split(vx_graph G, vx_tensor A, const std::vector< vx_tensor > & outputs, const std::vector< int > & split ={}, int axis =0) |

vx_node | Sqrt(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Squeeze(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}) |

vx_node | Sub(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

vx_node | Sum(vx_graph G, const std::vector< vx_tensor > & inputs, vx_tensor Z) |

vx_node | Tan(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | Tanh(vx_graph G, vx_tensor A, vx_tensor Z) |

vx_node | ThresholdedRelu(vx_graph G, vx_tensor A, vx_tensor Z, float alpha =1.0f) |

vx_node | Transpose(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & perm ={}) |

vx_node | Unsqueeze(vx_graph G, vx_tensor A, vx_tensor Z, const std::vector< int > & axes ={}) |

vx_node | Xor(vx_graph G, vx_tensor A, vx_tensor B, vx_tensor Z) |

## Functions Documentation¶

### function Abs¶

```
vx_node Abs(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise absolute operation.

For a rank-2 tensor, \(Z(x,y) = abs(A(x,y))\) $abs(x) = x $ for x >= 0 $abs(x) = -x $ for x < 0

### function Acos¶

```
vx_node Acos(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise arc cosine operation.

For a rank-2 tensor, \(Z(x,y) = acos(A(x,y))\)

### function Acosh¶

```
vx_node Acosh(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hyperbolic arc cosine operation.

For a rank-2 tensor, \(Z(x,y) = acosh(A(x,y))\)

### function Add¶

```
vx_node Add(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise addition operation.

For a rank-2 tensor, \(Z(x,y) = A(x,y) + B(x,y)\)

Supports numpy style broadcast. For details see: onnx_broadcast.

### function And¶

```
vx_node And(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise logical and operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) && B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast. For non-boolean input tensors zero is considered false, and non-zero true. If the output tensor is not boolean, then 0 is set for false, and 1 for true.

### function ArgMax¶

```
vx_node ArgMax(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int axis =0,
int keepdims =1,
int select_last_index =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**The output tensor.**axis**The axis in which to compute the arg indices.**keepdims**The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor will have the reduced dimension pruned.**select_last_index**If select_last_index is True (default False), the index of the last occurrence of the max is selected if the max appears more than once in the input. Otherwise the index of the first occurrence is selected. select_last_index = 1 is.*not supported*

**Return**: A reference to a vx node on success or a vx error object.

Computes the indices of the max elements of the input tensor's element along the provided axis.

The operation is about producing indices. For a rank-2 tensor, and axis=0, $ Z(y) = argmax(A(y));$ each 'y' produces an integer which is the index of the maxima for all the 'x' for the given 'y'.

### function ArgMin¶

```
vx_node ArgMin(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int axis =0,
int keepdims =1,
int select_last_index =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**The output tensor.**axis**The axis in which to compute the arg indices.**keepdims**The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulting tensor will have the reduced dimension pruned.**select_last_index**If select_last_index is True (default False), the index of the last occurrence of the min is selected if the min appears more than once in the input. Otherwise the index of the first occurrence is selected. select_last_index = 1 is.*not supported*

**Return**: A reference to a vx node on success or a vx error object.

Computes the indices of the max elements of the input tensor's element along the provided axis.

The operation is about producing indices. For a rank-2 tensor, and axis=0, $ Z(y) = argmin(A(y));$ each 'y' produces an integer which is the index of the minima for all the 'x' for the given 'y'.

### function Asin¶

```
vx_node Asin(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise arc sine operation.

For a rank-2 tensor, $Z(x,y) = asin(A(x,y)) $

### function Asinh¶

```
vx_node Asinh(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hyperbolic arc sine operation.

For a rank-2 tensor, $Z(x,y) = asinh(A(x,y)) $

### function Atan¶

```
vx_node Atan(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise arc tangent operation.

For a rank-2 tensor, $Z(x,y) = atan(A(x,y)) $

### function Atanh¶

```
vx_node Atanh(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hyperbolic arc tangent operation.

For a rank-2 tensor, $Z(x,y) = atanh(A(x,y)) $

### function AveragePool¶

```
vx_node AveragePool(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int ceil_mode =0,
const vx::Shape & kernel_shape ={},
const std::vector< uint32_t > & pads ={},
const std::vector< uint32_t > & strides ={},
int count_include_pad =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A.****Z**The output tensor.**ceil_mode**Whether to use ceil or floor (default) to compute the output shape.**kernel_shape**The surrounding window of operation.**pads**The zero padding along various axes.**strides**The downsampling ratio along various axes.**count_include_pad**Whether to include pad pixels when calculating values for the edges. Default is 0, doesn't count include pad.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise average pooling operation.

For a rank-3 tensor and kernel_shape {I,J,K},

For more info see: https://github.com/onnx/onnx/blob/main/docs/Operators.md#AveragePool

### function BatchNormalization¶

```
vx_node BatchNormalization(
vx_graph G,
vx_tensor A,
vx_tensor S,
vx_tensor B,
vx_tensor var,
vx_tensor mean,
vx_tensor Z,
float epsilon =0.00001f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**S**Scale tensor of shape (C).**B**Bias tensor of shape (C).**var**estimated variance tensor of shape (C).**mean**running estimated mean tensor of shape (C).**Z**The output tensor.**epsilon**A very small value so as to avoid divide by zero. It is implicitly converted to the type of input_variance.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise batch normalization operation.

Based on https://arxiv.org/abs/1502.03167. The input_mean and input_variance are known from training phase. $ Z(x,y,z) = S(z)*\frac{A(x,y,z)-mean}{\sqrt(variance+epsilon)}+B(z)$

### function BitShift¶

```
vx_node BitShift(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z,
ShiftDirection direction
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor**direction**Whether to shift left or right.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise arithmetic shift operation.

For a rank-2 tensor, and shift left, $Z(x,y) = A(x,y) << B(x,y) $ For a rank-3 tensor, and shift right, $Z(x,y,z) = A(x,y,z) >> B(x,y,z) $

Sign bit is preserved (extension) while shifting. Shifting by greater than or equal to the width of the type results in undefined output..

Supports numpy style broadcast. For details see: onnx_broadcast.

### function Ceil¶

```
vx_node Ceil(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise ceiling operation.

For a rank-2 tensor, $Z(x,y) = ceil(A(x,y)) $

### function Clip¶

```
vx_node Clip(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float min =1.17549435e-38f,
float max =3.38953139e+38f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**min**Minimum value, under which element is replaced by min.**max**Maximum value, above which element is replaced by max.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise clip operation.

Clip operator limits the given input within an interval. The interval is specified by the inputs 'min' and 'max'. They default to numeric_limits::lowest() and numeric_limits::max(), respectively.

For a rank-2 tensor, \(Z(x,y) = max\) where A(x,y) > max \(Z(x,y) = min\) where A(x,y) < max \(Z(x,y) = A(x,y)\) otherwise

### function Concat¶

```
vx_node Concat(
vx_graph G,
const std::vector< vx_tensor > & inputs,
vx_tensor Z,
int axis
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**inputs**The list of input tensors on which operator acts.**Z**The tensor holding the concatenated inputs.**axis**Which axis to concat on. A negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(inputs)

**Return**: A reference to a vx node on success or a vx error object.

Concatenate a list of tensors into a single tensor.

### function Conv¶

```
vx_node Conv(
vx_graph G,
vx_tensor A,
vx_tensor W,
vx_tensor B,
vx_tensor Z,
const std::vector< uint32_t > & dilations ={},
int group =1,
const vx::Shape & kernel_shape ={},
const std::vector< uint32_t > & pads ={},
const std::vector< uint32_t > & strides ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which the operator acts.**W**The weight tensor that will be used in the convolutions; has size (M x C/group x kH x kW), where C is the number of channels, and kH and kW are the height and width of the kernel, and M is the number of feature maps. Assuming zero based indices for the shape array, X.shape[1] == (W.shape[1] * group) == C and W.shape[0] mod G == 0. Or in other words FILTER_IN_CHANNEL multiplied by the number of groups should be equal to DATA_CHANNEL and the number of feature maps M should be a multiple of the number of groups G. The dimensions are {kernel_shape[0], kernel_shape[1], Cin, Cout}.**B**Bias to be added to the convolution.**Z**The output tensor.**dilations**dilation value along each spatial axis of the filter. If not present, the dilation defaults to 1 along each spatial axis.**group**number of groups input and output channels are divided into.**kernel_shape**The shape of the convolution kernel.**pads**Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis.`pads`

format should be as follows : [x1_begin, x2_begin...x1_end, x2_end,...] Where xi_begin is the number of pixels added at the beginning of axis`i`

and xi_end, the number of pixels added at the end of axis`i`

.**strides**Stride along each spatial axis.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise convolution operation.

For a rank-3 tensor and kernel_shape {I,J},

### function ConvTranspose¶

```
vx_node ConvTranspose(
vx_graph G,
vx_tensor A,
vx_tensor W,
vx_tensor B,
vx_tensor Z,
const std::vector< uint32_t > & dilations ={},
int group =1,
const vx::Shape & kernel_shape ={},
const std::vector< uint32_t > & output_padding ={},
const std::vector< uint32_t > & pads ={},
const std::vector< uint32_t > & strides ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which the operator acts.**W**The weight tensor that will be used in the convolutions; has size (M x C/group x kH x kW), where C is the number of channels, and kH and kW are the height and width of the kernel, and M is the number of feature maps. For more than 2 dimensions, the kernel shape will be (M x C/group x k1 x k2 x ... x kn), where (k1 x k2 x ... kn) is the dimension of the kernel.**B**Bias to be added to the convolution.**Z**The output tensor.**dilations**dilation value along each spatial axis of the filter. If not present, the dilation defaults is 1 along each spatial axis.**group**Number of groups input and output channels are divided into.**kernel_shape**The shape of the convolution kernel.**output_padding**Additional elements added to the side with higher coordinate indices in the output. Each padding value in "output_padding" must be less than the corresponding stride/dilation dimension. By default, this attribute is a zero vector. Note that this attribute doesn't directly affect the computed output values. It only controls the selection of the computed values, so changing this attribute only adds or removes output elements. If "output_shape" is explicitly provided, "output_padding" does not contribute additional size to "output_shape" but participates in the computation of the needed padding amount. This is also called adjs or adjustment in some frameworks.**pads**Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis.`pads`

format should be as follow`[x1_begin, x2_begin...x1_end, x2_end,...]`

, where xi_begin the number of pixels added at the beginning of axis`i`

and xi_end, the number of pixels added at the end of axis`i`

.**strides**Stride along each spatial axis.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise convolution operation.

For a rank-3 tensor and kernel_shape {I,J}, dilate the input first with putting stride-1 0s between rows and columns. Then perform the standard convolution.

### function Cos¶

```
vx_node Cos(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise cosine operation.

For a rank-2 tensor, $Z(x,y) = cos(A(x,y)) $

### function Cosh¶

```
vx_node Cosh(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hyperbolic cosine operation.

For a rank-2 tensor, $Z(x,y) = cosh(A(x,y)) $

### function CumSum¶

```
vx_node CumSum(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int axis =0,
int exclusive =0,
int reverse =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor**axis**The axis of summation.**exclusive**When set to 1, the first element is excluded in the sum.**reverse**When set to 1, the summation happens in the reverse direction of the axis.

**Return**: A reference to a vx node on success or a vx error object.

Performs cumulative sum of the input elements along the given axis.

By default, it will do the sum inclusively meaning the first element is copied as is. Through an exclusive attribute, this behavior can change to exclude the first element. It can also perform summation in the opposite direction of the axis. For that, pass reverse parameter as 1.

### function DepthToSpace¶

```
vx_node DepthToSpace(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int blocksize,
DepthToSpaceMode mode =DepthToSpaceMode::DCR
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of element-type as A. The dimensions are [N, C/(blocksize * blocksize), H * blocksize, W * blocksize]. Blocksize should be less than H and W.**blocksize**Blocks of [blocksize, blocksize] are moved.**mode**By default, mode = DCR. In the DCR mode, elements along the depth dimension from the input tensor are rearranged in the following order: depth, column, and then row. In the CRD mode, elements along the depth dimension from the input tensor are rearranged in the following order: column, row, and the depth.

**Return**: A reference to a vx node on success or a vx error object.

DepthToSpace rearranges (permutes) data from depth into blocks of spatial data.

This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of the input tensor where values from the depth dimension are moved in spatial blocks to the height and width dimensions.

### function Div¶

```
vx_node Div(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise division operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) / B(x,y) $ Division by 0 is not flagged. Supports numpy style broadcast. For details see: onnx_broadcast.

### function Elu¶

```
vx_node Elu(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float alpha =1.0f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**alpha**The coefficient in the formula above.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise elu operation.

For a rank-2 tensor, $Z(x,y) = elu(A(x,y)) $ $elu(x) = alpha * (pow(e, x) - 1) $ for x < 0 $elu(x) = x $ for x >= 0

### function Equal¶

```
vx_node Equal(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise is-equal-to operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) == B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast. If the output tensor is not boolean, then 0 is set for false, and 1 for true.

### function Erf¶

```
vx_node Erf(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise error-function operation.

For a rank-2 tensor, $Z(x,y) = erf(A(x,y)) $ $erf(x) = $ TODO.

### function Exp¶

```
vx_node Exp(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise exponent operation.

For a rank-2 tensor, $Z(x,y) = pow(e, A(x,y)) $

### function Expand¶

```
vx_node Expand(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of same element-type as A.

**Return**: A reference to a vx node on success or a vx error object.

Broadcast the input tensor following the given shape and the broadcast rule.

Numpy style of broadcasting is done. Two corresponding dimension must have the same value, or one of them is equal to.

Also, this operator is similar to numpy.broadcast_to(input, Z.shape), but the major difference is numpy.broadcast_to() does not allow shape to be smaller than input.size(). It is possible that the output shape is not equal to shape, when some dimensions in shape is equal to 1, or Z.shape.ndim < input.shape.ndim.

### function Floor¶

```
vx_node Floor(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise floor operation.

For a rank-2 tensor, $Z(x,y) = floor(A(x,y)) $

### function Gather¶

```
vx_node Gather(
vx_graph G,
vx_tensor A,
vx_tensor Z,
vx_tensor indices,
int axis =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of element-type as A.**indices**tensor containing the indices from where gather happens. Element-type is`INT32`

. to be within bounds [-s, s-1] along axis of size s.**axis**Which axis to gather on. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Performs gathering of the input elements along the given axis.

Given data tensor of rank r >= 1, and indices tensor of rank q, gather entries of the axis dimension of data (by default outer-most one as axis=0) indexed by indices, and concatenates them in an output tensor of rank q + (r - 1).

### function GatherElements¶

```
vx_node GatherElements(
vx_graph G,
vx_tensor A,
vx_tensor Z,
vx_tensor indices,
int axis =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of element-type as A.**indices**tensor containing the indices from where gather happens.**axis**The axis of gather. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Performs gathering of the input elements along the given axis.

GatherElements takes two inputs data and indices of the same rank r >= 1 and an optional attribute axis that identifies an axis of data (by default, the outer-most axis, that is axis 0). It is an indexing operation that produces its output by indexing into the input data tensor at index positions determined by elements of the indices tensor. Its output shape is the same as the shape of indices and consists of one value (gathered from the data) for each element in indices.

### function GatherND¶

```
vx_node GatherND(
vx_graph G,
vx_tensor A,
vx_tensor Z,
vx_tensor indices,
int batch_dims =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of element-type as A. The rank is q + r - indices_shape[-1] - 1.**indices**tensor of rank q >= 1. All index values are expected to be within bounds [-s, s-1] along axis of size s. Element-type is`INT32`

.**batch_dims**The number of batch dimensions. The gather of indexing starts from dimension of A[batch_dims:].

**Return**: A reference to a vx node on success or a vx error object.

Performs gathering of the input elements along the given axis.

Given data tensor of rank r >= 1, indices tensor of rank q >= 1, and batch_dims integer b, this operator gathers slices of data into an output tensor of rank q + r - indices_shape[-1] - 1 - b.

### function Gemm¶

```
vx_node Gemm(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor C,
vx_tensor Z,
float alpha =1.0f,
float beta =1.0f,
int transA =0,
int transB =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**C**The RHS tensor which gets added.**Z**Tensor of shape {M,N}. The tensor is broadcasted (unidirectional) to match the MxN output from multiplication of A and B.**alpha**The scalar coefficient in multiplication of A and B.**beta**The scalar coefficient to be multiplied with C.**transA**Whether A should be transposed before multiplication.**transB**Whether B should be transposed before multiplication.

**Return**: A reference to a vx node on success or a vx error object.

Performs matrix multiplication operation.

\(Y = alpha * A * B + beta * C\) The $A -> A' $ if transA = 1 The $B -> B' $ if transB = 1 For details see: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3

### function GlobalAveragePool¶

```
vx_node GlobalAveragePool(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**Output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs average pooling across the values in the same channel.

This is equivalent to AveragePool with kernel size equal to the spatial dimension of input tensor. See AveragePool.

For a rank-3 tensor of dimensions {I,J,K}, $ Z(z) = \frac{1}{I*J} * \sum_{j=0}^{J} \sum_{i=0}{I} (A(i,j,z)))$

### function GlobalLpPool¶

```
vx_node GlobalLpPool(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int p =2
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**Output tensor.**p**p value of the Lp norm used to pool over the input data.

**Return**: A reference to a vx node on success or a vx error object.

Performs LP pooling across the values in the same channel.

This is equivalent to LP pooling with kernel size equal to the spatial dimension of input tensor. See LpPool.

$ Z(z)=pow(\sum_{j=0}^{{J}\sum_{i=0}}pow((A(i,j,z)),p),\frac{1}{p})$

### function GlobalMaxPool¶

```
vx_node GlobalMaxPool(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**Output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs Max pooling across the values in the same channel.

This is equivalent to Max pooling with kernel size equal to the spatial dimension of input tensor. See MaxPool.

### function Greater¶

```
vx_node Greater(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise is-greater-than operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) > B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast. If the output tensor is not boolean, then 0 is set for false, and 1 for true.

### function HardSigmoid¶

```
vx_node HardSigmoid(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float alpha =0.2f,
float beta =0.5f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**alpha**The alpha as in formula above.**beta**The beta as in formula above.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hard-sigmoid operation.

For a rank-2 tensor, \(Z(x,y) = hardsigmoid(A(x,y))\) \(hardsigmoid(x) = max(0, min(1, alpha*x + beta))\)

### function Hardmax¶

```
vx_node Hardmax(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int axis =-1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**axis**The axis of operation. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Computes the hardmax along the given axis.

$hardmax(axis) = 1 $ if the element is the first maximum value along the axis. $hardmax(axis) = 0 $ otherwise.

### function Identity¶

```
vx_node Identity(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise copy.

For a rank-2 tensor, \(Z(x,y) = A(x,y)\)

### function InstanceNormalization¶

```
vx_node InstanceNormalization(
vx_graph G,
vx_tensor A,
vx_tensor Z,
vx_tensor S,
vx_tensor B,
float epsilon =0.00001f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**S**Scale tensor.**B**Bias tensor.**epsilon**A very small value so as to avoid divide by zero.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise instance normalization

For details see: https://arxiv.org/abs/1607.08022 For a rank-2 tensor \(Z(x,y) = instancenorm(A(x,y))\) \(instancenorm(x) = \frac{scale*(x-mean)}{\sqrt(variance+epsilon)} + B\) where mean and variance are computed per instance per channel.

### function IsInf¶

```
vx_node IsInf(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int detect_negative =1,
int detect_positive =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**detect_negative**Whether to map negative infinity to true. Default to 1 so that negative infinity induces true. Set this attribute to 0 if negative infinity should be mapped to false.**detect_positive**Whether to map positive infinity to true. Set this attribute to 0 if positive infinity should be mapped to false.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise is-infinity operation.

For a rank-2 tensor, \(Z(x,y) = isinf(A(x,y))\) $isinf(x) = 1 $ if x is infinity. $isinf(x) = 0 $ otherwise.

### function IsNaN¶

```
vx_node IsNaN(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise is-not-a-number operation.

For a rank-2 tensor, \(Z(x,y) = isnan(A(x,y))\) $isnan(x) = 0 $ if x is not-a-number. $isnan(x) = 1 $ otherwise.

### function LRN¶

```
vx_node LRN(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int size,
float alpha =0.0001f,
float beta =0.75f,
float bias =1.0f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**The output tensor.**size**The number of channels to include in summation.**alpha**The coefficient in above formula.**beta**The coefficient in above formula.**bias**The coefficient in above formula.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise local response normalization.

For details see: https://proceedings.neurips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf For a rank-2 tensor,

where s is the size.

### function LeakyRelu¶

```
vx_node LeakyRelu(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float alpha =1.0f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**alpha**The coefficient in the formula above.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise leaky-relu operation.

For a rank-2 tensor, $Z(x,y) = leakyrelu(A(x,y)) $ $leakyrelu(x) = alpha * x $ for x < 0 $leakyrelu(x) = x $ for x >= 0

### function Less¶

```
vx_node Less(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise is-less-than operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) < B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast. If the output tensor is not boolean, then 0 is set for false, and 1 for true.

### function Log¶

```
vx_node Log(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise natural-logarithm operation.

For a rank-2 tensor, $Z(x,y) = log(A(x,y)) $

### function LogSoftmax¶

```
vx_node LogSoftmax(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int axis =-1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**axis**Describes the dimension LogSoftmax will be performed on. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

computes the logarithm of softmax values along the given axis.

\(LogSoftmax(input, axis) = log(softmax(input, axis=axis)).\)

See Softmax.

### function LpNormalization¶

```
vx_node LpNormalization(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int p =2,
int axis =-1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**p**The order of the normalization, only 1 or 2 are supported.**axis**The axis on which to apply normalization, negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Computes the Lp normalization along the given axis.

### function LpPool¶

```
vx_node LpPool(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const vx::Shape & kernel_shape,
int p =2,
const std::vector< uint32_t > & pads ={},
const std::vector< uint32_t > & strides ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**kernel_shape**The size of the kernel along each axis.**p**p value of the Lp norm used to pool over the input data.**pads**Padding for the beginning and ending along each spatial axis.**strides**Stride along each spatial axis. If not present, the stride.

**Return**: A reference to a vx node on success or a vx error object.

LpPool onnx Operator

LpPool consumes an input tensor X and applies Lp pooling across the tensor according to kernel sizes, stride sizes, and pad lengths. Lp pooling consisting of computing the Lp norm on all values of a subset of the input tensor according to the kernel size and downsampling the data into the output tensor Y for further processing.

For kernel_shape {I,J}, $$ Z(x,y,z) = pow(\sum_{j=-J/2}^{J/2} \sum_{i=-I/2}^{I/2} pow((A(x+i,y+j,z)), p), \frac{1}{p}) $$

### function MatMul¶

```
vx_node MatMul(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs matrix multiplication of two tensors.

Matrix product that behaves like numpy.matmul: https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.matmul.html

### function Max¶

```
vx_node Max(
vx_graph G,
const std::vector< vx_tensor > & inputs,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**inputs**The list of input tensors on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise maximum operation over all inputs.

For a rank-2 tensor, \(Z(x,y) = max(inputs[0](x,y), ..., inputs[N-1](x,y))\)

Supports numpy style broadcast. For details see: onnx_broadcast.

### function MaxPool¶

```
vx_node MaxPool(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int ceil_mode =0,
const std::vector< uint32_t > & dilations ={},
const vx::Shape & kernel_shape ={},
const std::vector< uint32_t > & pads ={},
const std::vector< uint32_t > & strides ={},
int storage_order =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**Z**The output tensor.**ceil_mode**Whether to use ceil or floor (default) to compute the output shape.**dilations**Dilation value along each spatial axis of filter.**kernel_shape**The surrounding window of operation.**pads**The zero padding along various axes.**strides**The downsampling ratio along various axes.**storage_order**The storage order of the tensor. 0 is row major, and 1 is column major. storage_order = 1 is.*not supported*

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise max pooling operation.

For a rank-2 tensor and kernel_shape {sx,sy},

### function MaxRoiPool¶

```
vx_node MaxRoiPool(
vx_graph G,
vx_tensor A,
vx_tensor R,
vx_tensor Z,
const vx::Shape & pooled_shape
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**R**Rois (Regions of Interest) to pool over. Should be a 2-D tensor of shape (num_rois, 5) given as [[batch_id, x1, y1, x2, y2], ...]. For CHW input the batch_id should always be 0.**Z**The output tensor.**pooled_shape**Roi pool output shape.

**Return**: A reference to a vx node on success or a vx error object.

Performs for the given region-of-interest max pooling operation.

Roi max pool consumes an input tensor X (NCHW) and region of interests (Rois) to apply max pooling across each Roi, to produce output 4-D tensor of shape (num_rois, C, pooled_shape[W], pooled_shape[H]). see MaxPool.

### function MaxUnpool¶

```
vx_node MaxUnpool(
vx_graph G,
vx_tensor A,
vx_tensor I,
vx_tensor Z,
const vx::Shape & kernel_shape ={},
const std::vector< uint32_t > & pads ={},
const std::vector< uint32_t > & strides ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The tensor on which operator acts.**I**Tensor containing the indices of the maximas.**Z**The output tensor.**kernel_shape**The surrounding window of operation.**pads**The zero padding along various axes.**strides**The downsampling ratio along various axes.

**Return**: A reference to a vx node on success or a vx error object.

Computes the partial inverse of the MaxPool op.

The input information to this op is typically the the output information from a MaxPool op. The first input tensor X is the tensor that needs to be unpooled, which is typically the pooled tensor (first output) from MaxPool.

The second input tensor, I, contains the indices to the (locally maximal) elements corresponding to the elements in the first input tensor X. Input tensor I is typically the second output of the MaxPool op.

MaxUnpool is intended to do 'partial' inverse of the MaxPool op. 'Partial' because all the non-maximal values from the original input to MaxPool are set to zero in the output of the MaxUnpool op. Pooling the result of an unpooling operation should give back the original input to the unpooling op.

MaxUnpool can produce the same output size for several input sizes, which makes unpooling op ambiguous. The third input argument, output_size, is meant to disambiguate the op and produce output tensor of known/predictable size.

### function Mean¶

```
vx_node Mean(
vx_graph G,
const std::vector< vx_tensor > & inputs,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**inputs**The list of input tensors on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise mean operation over all inputs.

For a rank-2 tensor, \(Z(x,y) = mean(A1(x,y), A2(x,y), ..., An(x,y))\)

The mean here is the arithmetic mean.

### function Min¶

```
vx_node Min(
vx_graph G,
const std::vector< vx_tensor > & inputs,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**inputs**The list of input tensors on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise minimum operation over all inputs.

For a rank-2 tensor, \(Z(x,y) = min(inputs[0](x,y), ..., inputs[N-1](x,y))\)

Supports numpy style broadcast. For details see: onnx_broadcast.

### function Mod¶

```
vx_node Mod(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z,
int fmod =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor**fmod**Whether the operator should behave like fmod (default=0 meaning it will do integer mods); Set this to 1 to force fmod treatment.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise modulo operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) % B(x,y) $ Supports numpy style broadcast. For details see: onnx_broadcast.

### function Mul¶

```
vx_node Mul(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise multiplication operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) * B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast.

### function Neg¶

```
vx_node Neg(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise negate operation.

For a rank-2 tensor, $Z(x,y) = -A(x,y) $

### function NonMaxSuppression¶

```
vx_node NonMaxSuppression(
vx_graph G,
vx_tensor boxes,
vx_tensor scores,
vx_tensor selected_indices,
int center_point_box =0,
int max_output_boxes_per_class =0,
float iou_threshold =0.0f,
float score_threshold =0.0f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**boxes**Input tensor with shape [num_batches, spatial_dimension, 4].**scores**An input tensor with shape [num_batches, num_classes, spatial_dimension] num_classes greater than 1024 is.*not supported***selected_indices**Selected indices from the boxes tensor. [num_selected_indices, 3], the selected index format is [batch_index, class_index, box_index].-
**center_point_box**Integer indicate the format of the box data. The value 0 - the box data is supplied as [y1, x1, y2, x2] where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Mostly used for TF models. 1 -
the box data is supplied as [x_center, y_center, width, height]. Mostly used for Pytorch models.

**max_output_boxes_per_class**Maximum number of boxes to be selected per batch per class.**iou_threshold**Float representing the threshold for deciding whether boxes overlap too much with respect to IOU. Value range [0, 1]. Default to 0.**score_threshold**Float representing the threshold for deciding when to remove boxes based on score.

**Return**: A reference to a vx node on success or a vx error object.

Performs the non-maximal-suppression operation.

Filter out boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than score_threshold are removed. Bounding box format is indicated by attribute center_point_box.

Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm.

The selected_indices output is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the Gather or GatherND operation.

### function Not¶

```
vx_node Not(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise logical not operation.

For a rank-2 tensor, $Z(x,y) = not(A(x,y)) $ $neg(x) = 1 $ if x = 0; $neg(x) = 0 $ otherwise.

### function OneHot¶

```
vx_node OneHot(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int depth =0,
int axis =-1,
const std::vector< float > & values ={0.0, 0.0}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Input tensor containing indices. Any entries in the 'A' input tensor with values outside the range [-depth, depth-1] will result in one-hot representation with all 'off_value' values in the output tensor. In case 'indices' is of non-integer type, the values will be casted to int64 before use.**Z**Tensor of rank one greater than input tensor 'indices', i.e. rank(output) = rank(indices) + 1. the output tensor is the same as the type of input 'values' is used.**axis**Axis along which one-hot representation in added. Default: axis=-1 which means that the additional dimension will be inserted as the innermost/last dimension in the output tensor. Negative value means counting dimensions from the back.**depth**specifies the number of classes in one-hot tensor. This is also the size of the one-hot dimension (specified by 'axis' attribute) added on in the output tensor. The values in the 'indices' input tensor are expected to be in the range [-depth, depth-1]. In case 'depth' is of non-integer type, it will be casted to int64 before use.**values**Rank 1 tensor containing exactly two elements, in the format [off_value, on_value], where 'on_value' is the value used for filling locations specified in 'indices' input tensor, and 'off_value' is the value used for filling locations other than those specified in 'indices' input tensor.

**Return**: A reference to a vx node on success or a vx error object.

Produces a one-hot tensor based on inputs.

The locations represented by the index values in the 'indices' input tensor will have 'on_value' and the other locations will have 'off_value' in the output tensor, where 'on_value' and 'off_value' are specified as part of required input argument 'values', which is a two-element tensor of format [off_value, on_value].

The rank of the output tensor will be one greater than the rank of the input tensor. The additional dimension is for one-hot representation.

The additional dimension will be inserted at the position specified by 'axis'. If 'axis' is not specified then then additional dimension will be inserted as the innermost dimension, i.e. axis=-1. The size of the additional dimension is specified by required scalar input 'depth'.

The type of the output tensor is the same as the type of the 'values' input. Any entries in the 'indices' input tensor with values outside the range [-depth, depth-1] will result in one-hot representation with all 'off_value' values in the output tensor.

### function Or¶

```
vx_node Or(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise logical or operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) || B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast. For non-boolean input tensors zero is considered false, and non-zero true. If the output tensor is not boolean, then 0 is set for false, and 1 for true.

### function PRelu¶

```
vx_node PRelu(
vx_graph G,
vx_tensor A,
vx_tensor S,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**S**Tensor containing slope values.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise Prelu operation.

For a rank-2 tensor, $Z(x,y) = Prelu(A(x,y)) $ $Prelu(x) = slope * x $ for x < 0 $Prelu(x) = x $ for x >= 0 Supports numpy style broadcast. For details see: onnx_broadcast.

### function Pow¶

```
vx_node Pow(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise operation raising the first argument to the power of the second argument.

For a rank-2 tensor, $Z(x,y) = pow(A(x,y), B(x,y)) $ Supports numpy style broadcast. For details see: onnx_broadcast.

### function Reciprocal¶

```
vx_node Reciprocal(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise reciprocal operation.

For a rank-2 tensor, $Z(x,y) = rcp(A(x,y)) $ $rcp(x) = 1 / x $ for x != 0 \(rcp(x) = NaN\) for x == 0

### function ReduceL1¶

```
vx_node ReduceL1(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the L1 norm of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ 1norm(X) = (\sum_{i=1}^{n} |Xi|) $

### function ReduceL2¶

```
vx_node ReduceL2(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the L2 norm of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ 2norm(X) = (\sum_{i=1}^{n} (|Xi| ^ 2)) ^ (\frac{1}{2}) $

### function ReduceLogSum¶

```
vx_node ReduceLogSum(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the log-sum of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ logsum(X) = log(\sum_{i=1}^{n} Xi) $

### function ReduceLogSumExp¶

```
vx_node ReduceLogSumExp(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the log-sum-exponent of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ logsum(X) = log(\sum_{i=1}^{n} e^Xi) $

### function ReduceMax¶

```
vx_node ReduceMax(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the max of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ max(X) = maximum of {Xi} $

### function ReduceMean¶

```
vx_node ReduceMean(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the mean of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ mean(X) = \frac{1}{n} * \sum_{i=1}^{n} Xi$

### function ReduceMin¶

```
vx_node ReduceMin(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the min of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ max(X) = minimum of {Xi} $

### function ReduceProd¶

```
vx_node ReduceProd(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the product of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ prod(X) = \prod_{i=1}^{n} Xi$

### function ReduceSum¶

```
vx_node ReduceSum(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the sum of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ sum(X) = \sum_{i=1}^{n} Xi$

### function ReduceSumSquare¶

```
vx_node ReduceSumSquare(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={},
int keepdims =1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Output tensor.**axes**A list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Negative value means counting dimensions from the back.**keepdims**If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. If keepdims is 1, The resulting tensor has the same rank as the input.

**Return**: A reference to a vx node on success or a vx error object.

Computes the sum-square of the input tensor's element along the provided axes.

For Rank-1 values of X = {X1,...,Xn} $ sum(X) = \sum_{i=1}^{n} Xi^2$

### function Relu¶

```
vx_node Relu(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise relu operation.

For a rank-2 tensor, $Z(x,y) = relu(A(x,y)) $ $relu(x) = 0 $ for x < 0 $relu(x) = x $ for x >= 0

### function Reshape¶

```
vx_node Reshape(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of element-type as A. Number elements should be same as A.

**Return**: A reference to a vx node on success or a vx error object.

Reshape the input tensor as the shape of output.

### function Resize¶

```
vx_node Resize(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< float > & scales ={},
vx_tensor roi =nullptr,
InterpolationMode mode =InterpolationMode::NEAREST,
CoordinateTransformationMode coordinate_transformation_mode =CoordinateTransformationMode::HALF_PIXEL,
NearestMode nearest_mode =NearestMode::ROUND_PREFER_FLOOR,
int exclude_outside =0,
float extrapolation_value =0.0f,
float cubic_coeff_a =-0.75f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**scales**he scale array along each dimension. It takes value greater than 0. If it's less than 1, it's sampling down, otherwise, it's upsampling. The number of elements of 'scales' should be the same as the rank of input 'X'. One of 'scales' and 'sizes' MUST be specified and it is an error if both are specified. If 'sizes' is needed, the user can use an empty string as the name of 'scales' in this operator's input list**roi**1-D tensor given as [start1, ..., startN, end1, ..., endN], where N is the rank of X. The RoIs' coordinates are normalized in the coordinate system of the input image. It only takes effect when coordinate_transformation_mode is "tf_crop_and_resize"**mode**Three interpolation modes: nearest (default), linear and cubic. The "linear" mode includes linear interpolation for 1D tensor and N-linear interpolation for N-D tensor (for example, bilinear interpolation for 2D tensor). The "cubic" mode includes cubic interpolation for 1D tensor and N-cubic interpolation for N-D tensor (for example, bicubic interpolation for 2D tensor).**coordinate_transformation_mode**This attribute describes how to transform the coordinate in the resized tensor to the coordinate in the original tensor. The coordinate of each dimension is transformed individually. Let's describe a case using axis x as an example. Denote x_resized as the coordinate of axis x in the resized tensor, x_original as the coordinate of axis x in the original tensor, length_original as the length of the original tensor in axis x, length_resized as the length of the resized tensor in axis x, roi_x = (start_x, end_x) of the axis x in input "roi", scale = length_resized / length_original,

Resize the input tensor.

In general, calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor. Each dimension value of the output tensor is: \(output_dim = floor(input_dim * (roi_end - roi_start) * scale)\) if coordinate_transformation_mode is "half_pixel", x_original = (x_resized + 0.5) / scale - 0.5,

if coordinate_transformation_mode is "pytorch_half_pixel", x_original = length_resized > 1 ? (x_resized + 0.5) / scale - 0.5 : 0,

if coordinate_transformation_mode is "align_corners", x_original = x_resized * (length_original - 1) / (length_resized - 1),

if coordinate_transformation_mode is "asymmetric", x_original = x_resized / scale,

if coordinate_transformation_mode is "tf_crop_and_resize", x_original = length_resized > 1 ? start_x * (length_original - 1)

- x_resized * (end_x - start_x) * (length_original - 1) / (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original - 1). nearest_modeFour modes: round_prefer_floor (default, also known as round half down), round_prefer_ceil (also known as round half up), floor, ceil. Indicates how to get "nearest" pixel in input tensor from x_original, so this attribute is valid only if "mode" is "nearest".

exclude_outsideIf set to 1, the weight of sampling locations outside the tensor will be set to 0 and the weight will be renormalized so that their sum is 1.0. The default value is 0.

extrapolation_valueWhen coordinate_transformation_mode is "tf_crop_and_resize" and x_original is outside the range `[0, length_original - 1]`

, this value is used as the corresponding output value. Default is 0.0f.

cubic_coeff_aThe coefficient 'a' used in cubic interpolation. Two common choice are -0.5 (in some cases of TensorFlow) and -0.75 (in PyTorch). Check out Equation (4) in https://ieeexplore.ieee.org/document/1163711 for the details. This attribute is valid only if "mode" is "cubic".

A reference to a vx node on success or a vx error object.

### function RoiAlign¶

```
vx_node RoiAlign(
vx_graph G,
vx_tensor A,
vx_tensor R,
vx_tensor Z,
RoiAlignMode mode =RoiAlignMode::AVG,
int output_height =1,
int output_width =1,
int sampling_ratio =0,
float spatial_scale_factor =1.0f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**R**Tensor containing the RoIs.**Z**Tensor of element-type as A. Number elements should be same as A.**mode**The pooling method. Two modes are supported: 'avg' and 'max'. Default is 'avg'.**output_height**Pooled output Y's height.**output_width**Pooled output Y's width.**sampling_ratio**Number of sampling points in the interpolation grid used to compute the output value of each pooled output bin. If > 0, then exactly sampling_ratio x sampling_ratio grid points are used. If == 0, then an adaptive number of grid points are used (computed as ceil(roi_width / output_width), and likewise for height).**spatial_scale_factor**Multiplicative spatial scale factor to translate ROI coordinates from their input spatial scale to the scale used when pooling, i.e., spatial scale of the input feature map X relative to the input image.**coordinate_transformation_mode**Allowed values are 'half_pixel' and 'output_half_pixel'. Use the value 'half_pixel' to pixel shift the input coordinates by -0.5 (the recommended behavior). Use the value 'output_half_pixel' to omit the pixel shift for the input (use this for a backward-compatible behavior).

**Return**: A reference to a vx node on success or a vx error object.

Align the region of interests.

Region of Interest (RoI) align operation described in the Mask R-CNN paper. RoiAlign consumes an input tensor X and region of interests (rois) to apply pooling across each RoI; it produces a 4-D tensor of shape (num_rois, C, output_height, output_width).

RoiAlign is proposed to avoid the misalignment by removing quantizations while converting from original image into feature map and from feature map into RoI feature; in each ROI bin, the value of the sampled locations are computed directly through bilinear interpolation.

### function Round¶

```
vx_node Round(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise rounding operation.

For a rank-2 tensor, $Z(x,y) = round(A(x,y)) $ $round(integer.fraction) = integer $ if fraction < 0.5. $round(integer.fraction) = integer+1 $ if fraction > 0.5 and number > 0. $round(integer.fraction) = integer-1 $ if fraction > 0.5 and number < 0. $round(integer.fraction) = rtne() $ if fraction = 0.5.

### function ScatterElements¶

```
vx_node ScatterElements(
vx_graph G,
vx_tensor A,
vx_tensor updates,
vx_tensor Z,
vx_tensor indices,
int axis =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**updates**Tensor of rank r >=1 (same rank and shape as indices)**Z**Tensor of rank r >= 1 (same rank as input).**indices**Tensor of rank r >= 1 (same rank as input).**axis**Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(A)

**Return**: A reference to a vx node on success or a vx error object.

ScatterElements onnx Operator

Takes three inputs data, updates, and indices of the same rank r >= 1 and an optional attribute axis that identifies an axis of data (by default, the outer-most axis, that is axis 0). The output of the operation is produced by creating a copy of the input data, and then updating its value to values specified by updates at specific index positions specified by indices. Its output shape is the same as the shape of data.

For each entry in updates, the target index in data is obtained by combining the corresponding entry in indices with the index of the entry itself: the index-value for dimension = axis is obtained from the value of the corresponding entry in indices and the index-value for dimension != axis is obtained from the index of the entry itself.

### function ScatterND¶

```
vx_node ScatterND(
vx_graph G,
vx_tensor A,
vx_tensor updates,
vx_tensor Z,
vx_tensor indices
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**updates**Tensor of rank r >=1 (same rank and shape as indices)**Z**Tensor of rank r >= 1 (same rank as input).**indices**Tensor of rank r >= 1 (same rank as input).

**Return**: A reference to a vx node on success or a vx error object.

ScatterND onnx Operator

Takes three inputs data tensor of rank r >= 1, indices tensor of rank q >= 1, and updates tensor of rank $ q + r - indices.shape[-1] - 1 $ .

The output of the operation is produced by creating a copy of the input data, and then updating its value to values specified by updates at specific index positions specified by indices.

Its output shape is the same as the shape of data. Note that indices should not have duplicate entries. That is, two or more updates for the same index-location is not supported. indices is an integer tensor. Let k denote indices.shape[-1], the last dimension in the shape of indices. indices is treated as a (q-1)-dimensional tensor of k-tuples, where each k-tuple is a partial-index into data. Hence, k can be a value at most the rank of data.

When k equals rank(data), each update entry specifies an update to a single element of the tensor. When k is less than rank(data) each update entry specifies an update to a slice of the tensor.

updates is treated as a (q-1)-dimensional tensor of replacement-slice-values. Thus, the first (q-1) dimensions of updates.shape must match the first (q-1) dimensions of indices.shape. The remaining dimensions of updates correspond to the dimensions of the replacement-slice-values. Each replacement-slice-value is a (r-k) dimensional tensor, corresponding to the trailing (r-k) dimensions of data. Thus, the shape of updates must equal `indices.shape[0:q-1] ++ data.shape[k:r-1]`

, where ++ denotes the concatenation of shapes.

### function Selu¶

```
vx_node Selu(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float alpha =1.67326f,
float gamma =1.0507f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**alpha**The coefficient in the formula above.**gamma**The coefficient in the formula above.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise selu operation.

For a rank-2 tensor, $Z(x,y) = selu(A(x,y)) $ $selu(x) = gamma * (alpha * pow(e, x) - alpha) $ for x <= 0 $selu(x) = gamma * x $ for x > 0

### function Shrink¶

```
vx_node Shrink(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float bias =0.0f,
float lambd =0.5f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**bias**The coefficient in the formula above.**lambd**The threshold in the formula above.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise shrink operation.

For a rank-2 tensor, $Z(x,y) = shrink(A(x,y)) $ $shrink(x) = x + bias $ for x < -lambda $shrink(x) = x - bias $ for x > lambda $shrink(x) = 0 $ otherwise.

### function Sigmoid¶

```
vx_node Sigmoid(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise sigmoid operation.

For a rank-2 tensor, $Z(x,y) = sigmoid(A(x,y)) $ \(sigmoid(x) = 1 / ( 1 + pow(e, {-x}))\)

### function Sign¶

```
vx_node Sign(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise sign operation.

For a rank-2 tensor, $Z(x,y) = sign(A(x,y)) $ $sign(x) = 1 $ if x > 0 $sign(x) = -1 $ if x < 0 $sign(x) = 0 $ if x = 0

### function Sin¶

```
vx_node Sin(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise sine operation.

For a rank-2 tensor, $Z(x,y) = sin(A(x,y)) $

### function Sinh¶

```
vx_node Sinh(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hyperbolic sine operation.

For a rank-2 tensor, $Z(x,y) = sinh(A(x,y)) $

### function Slice¶

```
vx_node Slice(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & starts,
const std::vector< int > & ends,
const std::vector< int > & axes ={},
const std::vector< int > & steps ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of element-type as A.**starts**starting indices of corresponding axis in`axes`

**ends**ending indices (exclusive) of corresponding axis in`axes`

**axes**axes that`starts`

and`ends`

apply to. Negative value means counting dimensions from the back.**steps**slice step of corresponding axis in`axes`

. Negative value means slicing backward. 'steps' cannot be 0.

**Return**: A reference to a vx node on success or a vx error object.

Produces a slice of the input tensor along multiple axes.

Similar to numpy: https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html

Slices uses starts, ends, axes and steps inputs to specify the start and end dimension and step for each axis in the list of axes, it uses this information to slice the input data tensor. If a negative value is passed for any of the start or end indices, it represents number of elements before the end of that dimension. If the value passed to start or end is larger than the n (the number of elements in this dimension), it represents n. For slicing to the end of a dimension with unknown size, it is recommended to pass in INT_MAX when slicing forward and 'INT_MIN' when slicing backward. If a negative value is passed for step, it represents slicing backward. However step value cannot be 0.

### function Softmax¶

```
vx_node Softmax(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int axis =-1
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**axis**Describes the dimension Softmax will be performed on. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Computes the normalized exponential values for the given input:

\(Softmax(input, axis) = Exp(input) / ReduceSum(Exp(input), axis=axis, keepdims=1).\)

See ReduceSum. For Rank-1 values of X = {X1,...,Xn}

$ Softmax(Xi) = \frac{pow(e, Xi)}{pow(\sum_{i=1}, {n}) Xi}$

### function Softplus¶

```
vx_node Softplus(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise softplus operation.

For a rank-2 tensor, $Z(x,y) = softplus(A(x,y)) $ $softplus(x) = log(pow(e, x) + 1) $ for x < 0

### function Softsign¶

```
vx_node Softsign(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise softsign operation.

For a rank-2 tensor, $Z(x,y) = softsign(A(x,y)) $ $softsign(x) = \frac{x}{1+|x|} $

### function SpaceToDepth¶

```
vx_node SpaceToDepth(
vx_graph G,
vx_tensor A,
vx_tensor Z,
int blocksize
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of same element-type as A. [N, C*(blocksize*blocksize), H/blocksize, W/blocksize]. Blocksize should be less H and W.**blocksize**The size of the blocks of data to rearrange.

**Return**: A reference to a vx node on success or a vx error object.

Rearranges blocks of spatial data into depth.

More specifically, this op outputs a copy of the input tensor where values from the height and width dimensions are moved to the depth dimension.

### function Split¶

```
vx_node Split(
vx_graph G,
vx_tensor A,
const std::vector< vx_tensor > & outputs,
const std::vector< int > & split ={},
int axis =0
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The on which the operator acts.**outputs**The list of output tensors the operator produces. Tensors should have the same rank and element-type as A.**split**The values of lengths of each splits. Values should be >= 0. Sum of the values must be equal to the dim value at 'axis' specified.**axis**Which axis to split on. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Split a tensor into a list of tensors, along the specified 'axis'.

Lengths of the parts can be specified using input 'split'. Otherwise, the tensor is split to equal sized parts.

### function Sqrt¶

```
vx_node Sqrt(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise square-root operation.

For a rank-2 tensor, $Z(x,y) = \sqrt(A(x,y)) $

### function Squeeze¶

```
vx_node Squeeze(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of same size and element-type as A.**axes**List of integers indicating the dimensions to squeeze. Negative value means counting dimensions from the back.

**Return**: A reference to a vx node on success or a vx error object.

Remove single-dimensional entries from the shape of a tensor.

Takes an input axes with a list of axes to squeeze. If axes is not provided, all the single dimensions will be removed from the shape. If an axis is selected with shape entry not equal to one, an error is raised.

### function Sub¶

```
vx_node Sub(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise subtraction operation.

For a rank-2 tensor, \(Z(x,y) = A(x,y) - B(x,y)\)

Supports numpy style broadcast. For details see: onnx_broadcast.

### function Sum¶

```
vx_node Sum(
vx_graph G,
const std::vector< vx_tensor > & inputs,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**inputs**The list of input tensors on which operator acts.**Z**The output tensor

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise sum operation over all inputs.

For a rank-2 tensor, \(Z(x,y) = sum(A1(x,y), A2(x,y), ..., An(x,y))\)

### function Tan¶

```
vx_node Tan(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise tangent operation.

For a rank-2 tensor, $Z(x,y) = tan(A(x,y)) $

### function Tanh¶

```
vx_node Tanh(
vx_graph G,
vx_tensor A,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output Tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise hyperbolic tangent operation.

For a rank-2 tensor, $Z(x,y) = tanh(A(x,y)) $

### function ThresholdedRelu¶

```
vx_node ThresholdedRelu(
vx_graph G,
vx_tensor A,
vx_tensor Z,
float alpha =1.0f
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**The output tensor.**alpha**The coefficient in the formula above.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise thresholded relu operation.

For a rank-2 tensor, $Z(x,y) = thresholdedrelu(A(x,y)) $ $thresholdedrelu(x) = x $ for x > alpha $thresholdedrelu(x) = 0 $ otherwise.

### function Transpose¶

```
vx_node Transpose(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & perm ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of same size and element-type as A. The shape is governed by the permutation list.**perm**A list of integers. By default, reverse the dimensions, otherwise permute the axes according to the values given.

**Return**: A reference to a vx node on success or a vx error object.

Transpose the input tensor.

For example, when perm=(1, 0, 2), given an input tensor of shape (1, 2, 3), the output shape will be (2, 1, 3).

### function Unsqueeze¶

```
vx_node Unsqueeze(
vx_graph G,
vx_tensor A,
vx_tensor Z,
const std::vector< int > & axes ={}
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**Tensor on which the operator acts.**Z**Tensor of same size and element-type as A.**axes**List of integers indicating the dimensions to squeeze. Negative value means counting dimensions from the back. The input axes should not contain any duplicate entries.

**Return**: A reference to a vx node on success or a vx error object.

Insert single-dimensional entries to the shape of an input tensor.

Takes one required input axes - which contains a list of dimension indices and this operator will insert a dimension of value 1 into the corresponding index of the output tensor.

### function Xor¶

```
vx_node Xor(
vx_graph G,
vx_tensor A,
vx_tensor B,
vx_tensor Z
)
```

**Parameters**:

**G**The vx graph to which the node will belong.**A**The LHS tensor on which operator acts.**B**The RHS tensor on which operator acts.**Z**The output tensor.

**Return**: A reference to a vx node on success or a vx error object.

Performs element-wise logical xor operation.

For a rank-2 tensor, $Z(x,y) = A(x,y) xor B(x,y) $

Supports numpy style broadcast. For details see: onnx_broadcast. For non-boolean input tensors zero is considered false, and non-zero true. If the output tensor is not boolean, then 0 is set for false, and 1 for true.

Updated on 2023-11-29 at 18:22:22 +0000