Div - version 6#
This page documents version 6 of operator Div. See Div for the latest version (since version 14).
Domain:
ai.onnxSince version: 6
Performs element-wise binary division (with limited broadcast support). If necessary the right-hand-side argument will be broadcasted to match the shape of left-hand-side argument. When broadcasting is specified, the second tensor can either be of element size 1 (including a scalar tensor and any tensor with rank equal to or smaller than the first tensor), or having its shape as a contiguous subset of the first tensor’s shape. The starting of the mutually equal shape is specified by the argument “axis”, and if it is not set, suffix matching is assumed. 1-dim expansion doesn’t work yet.
For example, the following tensor shapes are supported (with broadcast=1):
shape(A) = (2, 3, 4, 5), shape(B) = (,), i.e. B is a scalar tensor
shape(A) = (2, 3, 4, 5), shape(B) = (1, 1), i.e. B is an 1-element tensor
shape(A) = (2, 3, 4, 5), shape(B) = (5,)
shape(A) = (2, 3, 4, 5), shape(B) = (4, 5)
shape(A) = (2, 3, 4, 5), shape(B) = (3, 4), with axis=1
shape(A) = (2, 3, 4, 5), shape(B) = (2), with axis=0
Attribute broadcast=1 needs to be passed to enable broadcasting.
For integer inputs, the result is computed using truncating division (rounding toward zero).
Inputs
A (T): First operand, should share the type with the second operand.
B (T): Second operand. With broadcasting can be of smaller size than A. If broadcasting is disabled it should be of the same size.
Outputs
C (T): Result, has same dimensions and type as A
Type Constraints
T: Constrain input and output types to high-precision numeric tensors. Allowed types: tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64).
Differences with previous version (1)#
SchemaDiff: Div (domain 'ai.onnx')
old version: 1
new version: 6
breaking: no
Type constraints:
changed ‘T’: added types: [‘tensor(int32)’, ‘tensor(int64)’, ‘tensor(uint32)’, ‘tensor(uint64)’]
Documentation:
line similarity: 0.95 (+2/-0 lines)
--- Div v1
+++ Div v6
@@ -17,3 +17,5 @@
shape(A) = (2, 3, 4, 5), shape(B) = (2), with axis=0
Attribute `broadcast=1` needs to be passed to enable broadcasting.
+
+For integer inputs, the result is computed using truncating division (rounding toward zero).