@@ -769,7 +769,7 @@ implementations (even if a seed is specified).
769769
770770Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<22>`
771771
772- Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
772+ Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ResultTypeInferenceOpInterface`, ` ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
773773
774774Effects: `MemoryEffects::Effect{}`
775775
@@ -1017,7 +1017,7 @@ See documentation of the Cast operator for further details.
10171017
10181018Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<21>`
10191019
1020- Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
1020+ Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ResultTypeInferenceOpInterface`, ` ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
10211021
10221022Effects: `MemoryEffects::Effect{}`
10231023
@@ -1122,28 +1122,31 @@ deep models. By default the conversion of a float *x* obeys
11221122to the following rules. `[x]` means the value rounded to
11231123the target mantissa width.
11241124
1125- | x | E4M3FN | E4M3FNUZ | E5M2 | E5M2FNUZ |
1126- |------|----|----|----|----|
1127- | 0 | 0 | 0 | 0 | 0 |
1128- |-0 | -0 | 0 | -0 | 0 |
1129- | NaN | NaN | NaN | NaN | NaN |
1130- | +/- Inf | +/- FLT_MAX | NaN | FLT_MAX | NaN |
1131- | [x] > FLT_MAX | FLT_MAX | FLT_MAX | FLT_MAX | FLT_MAX |
1132- | [x] < -FLT_MAX | -FLT_MAX | -FLT_MAX | -FLT_MAX | -FLT_MAX |
1133- | else | RNE | RNE | RNE | RNE |
1125+ | x | E4M3FN | E4M3FNUZ | E5M2 | E5M2FNUZ |
1126+ | ----------------- | -------- | -------- | -------- | -------- |
1127+ | 0 | 0 | 0 | 0 | 0 |
1128+ | -0 | -0 | 0 | -0 | 0 |
1129+ | NaN | NaN | NaN | NaN | NaN |
1130+ | Inf | FLT_MAX | NaN | FLT_MAX | NaN |
1131+ | -Inf | -FLT_MAX | NaN | -FLT_MAX | NaN |
1132+ | \[x\] > FLT_MAX | FLT_MAX | FLT_MAX | FLT_MAX | FLT_MAX |
1133+ | \[x\] \< -FLT_MAX | -FLT_MAX | -FLT_MAX | -FLT_MAX | -FLT_MAX |
1134+ | else | RNE | RNE | RNE | RNE |
11341135
11351136The behavior changes if the parameter 'saturate' is set to False.
11361137The rules then become:
11371138
1138- | x | E4M3FN | E4M3FNUZ | E5M2 | E5M2FNUZ |
1139- |------|----|----|----|----|
1140- | 0 | 0 | 0 | 0 | 0 |
1141- |-0 | -0 | 0 | -0 | 0 |
1142- | NaN | NaN | NaN | NaN | NaN |
1143- | +/- Inf | NaN | NaN | +/- Inf | NaN |
1144- | [x] > FLT_MAX | NaN | NaN | Inf | NaN |
1145- | [x] < -FLT_MAX | NaN | NaN | -Inf | NaN |
1146- | else | RNE | RNE | RNE | RNE |
1139+ | x | E4M3FN | E4M3FNUZ | E5M2 | E5M2FNUZ |
1140+ | ----------------- | ------ | -------- | ---- | -------- |
1141+ | 0 | 0 | 0 | 0 | 0 |
1142+ | -0 | -0 | 0 | -0 | 0 |
1143+ | NaN | NaN | NaN | NaN | NaN |
1144+ | -NaN | -NaN | NaN | -NaN | NaN |
1145+ | Inf | NaN | NaN | Inf | NaN |
1146+ | -Inf | -NaN | NaN | -Inf | NaN |
1147+ | \[x\] > FLT_MAX | NaN | NaN | Inf | NaN |
1148+ | \[x\] \< -FLT_MAX | NaN | NaN | -Inf | NaN |
1149+ | else | RNE | RNE | RNE | RNE |
11471150
11481151Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<21>`
11491152
@@ -1281,12 +1284,18 @@ _ONNX CenterCropPad operation_
12811284
12821285Center crop or pad an input to given dimensions.
12831286
1284- The crop/pad dimensions can be specified for a subset of the `axes`. Non-specified dimensions will not be
1285- cropped or padded.
1287+ The crop/pad dimensions can be specified for a subset of the `axes`; unspecified dimensions will remain unchanged.
1288+
1289+ If the input dimensions are larger than the target crop dimensions, a centered cropping window will be extracted
1290+ from the input. The starting value for the cropping window is rounded down, which means that if the difference
1291+ between the input shape and the crop shape is odd, the cropping window will be shifted half a pixel to the left
1292+ of the input center.
12861293
1287- If the input dimensions are bigger than the crop shape, a centered cropping window is extracted from the input.
1288- If the input dimensions are smaller than the crop shape, the input is padded on each side equally,
1289- so that the input is centered in the output.
1294+ If the input dimensions are smaller than the target crop dimensions, the input will be padded equally on both sides
1295+ to center it in the output. In cases where the total number of padding pixels is odd, an additional pixel will be
1296+ added to the right side.
1297+
1298+ The padding value used is zero.
12901299
12911300Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<18>`
12921301
@@ -1321,6 +1330,8 @@ _ONNX Clip operation_
13211330Clip operator limits the given input within an interval. The interval is
13221331specified by the inputs 'min' and 'max'. They default to
13231332numeric_limits::lowest() and numeric_limits::max(), respectively.
1333+ When 'min' is greater than 'max', the clip operator sets all the 'input' values to
1334+ the value of 'max'. Thus, this is equivalent to 'Min(max, Max(input, min))'.
13241335
13251336Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<13>`
13261337
@@ -2185,7 +2196,6 @@ full-precision tensor. The dequantization formula is `y = (x - x_zero_point) * x
21852196must have the same shape, determining the quantization's granularity: a scalar for per-tensor/per-layer quantization,
21862197a 1-D tensor for per-axis quantization, or have a rank identical to the input for blocked quantization.
21872198See QuantizeLinear for details on quantization granularity.
2188-
21892199`x_zero_point` and `x` must have the same type. `x` and `y` must have the same shape. In the case of dequantizing
21902200`int32`, there's no zero point (zero point is supposed to be 0).
21912201`zero-point` is usually not used in the case of float8 types quantization, but the dequantization formula remains the same
@@ -3129,7 +3139,22 @@ Given `data` tensor of rank r >= 1, and `indices` tensor of rank q, gather
31293139entries of the axis dimension of `data` (by default outer-most one as axis=0) indexed by `indices`, and concatenates
31303140them in an output tensor of rank q + (r - 1).
31313141
3132- If `axis = 0`, let `k = indices[i_{0}, ..., i_{q-1\}\]`
3142+ It is an indexing operation that indexes into the input `data` along a single (specified) axis.
3143+ Each entry in `indices` produces a `r-1` dimensional slice of the input tensor.
3144+ The entire operation produces, conceptually, a `q`-dimensional tensor of `r-1` dimensional slices,
3145+ which is arranged into a `q + (r-1)`-dimensional tensor, with the `q` dimensions taking the
3146+ place of the original `axis` that is being indexed into.
3147+
3148+ The following few examples illustrate how `Gather` works for specific shapes of `data`,
3149+ `indices`, and given value of `axis`:
3150+ | data shape | indices shape | axis | output shape | output equation |
3151+ | --- | --- | --- | --- | --- |
3152+ | (P, Q) | ( ) (a scalar) | 0 | (Q) | output[q] = data[indices, q] |
3153+ | (P, Q, R) | ( ) (a scalar) | 1 | (P, R) | output[p, r] = data[p, indices, r] |
3154+ | (P, Q) | (R, S) | 0 | (R, S, Q) | output[r, s, q] = data[ [indices[r, s], q] |
3155+ | (P, Q) | (R, S) | 1 | (P, R, S) | output[p, r, s] = data[ p, indices[r, s]] |
3156+
3157+ More generally, if `axis = 0`, let `k = indices[i_{0}, ..., i_{q-1\}\]`
31333158then `output[i_{0}, ..., i_{q-1}, j_{0}, ..., j_{r-2\}\] = input[k , j_{0}, ..., j_{r-2\}\]`:
31343159
31353160```
@@ -3740,7 +3765,7 @@ This operator transforms input according to
37403765y = scale * (x - mean) / sqrt(variance + epsilon) + bias,
37413766```
37423767where the mean and variance are computed per instance per group of channels, and
3743- `scale` and `bias` should be specified for each group of channels . The number of
3768+ `scale` and `bias` should be specified for each channel . The number of
37443769groups `num_groups` should be divisible by the number of channels so that there are
37453770an equal number of channels per group.
37463771
@@ -5403,19 +5428,23 @@ Effects: `MemoryEffects::Effect{}`
54035428
54045429_ONNX Mod operation_
54055430
5406- Performs element-wise binary modulus (with Numpy-style broadcasting support) .
5407- The sign of the remainder is the same as that of the Divisor .
5431+ Performs an element-wise binary modulo operation .
5432+ The semantics and supported data types depend on the value of the `fmod` attribute which must be `0` (default), or `1` .
54085433
5409- Mod operator can also behave like C fmod() or numpy.fmod. In this case, the sign of the remainder however, will be the same as the Dividend
5410- (in contrast to integer mod). To force a behavior like numpy.fmod() an 'fmod' Attribute is provided.
5411- This attribute is set to 0 by default causing the behavior to be like integer mod.
5412- Setting this attribute to 1 causes the remainder to be calculated similar to that of numpy.fmod().
5434+ If the `fmod` attribute is set to `0`, `T` is constrained to integer data types and the semantics follow that of the Python `%`-operator.
5435+ The sign of the result is that of the divisor.
54135436
5414- If the input type is floating point, then `fmod` attribute must be set to 1.
5437+ If `fmod` is set to `1`, the behavior of this operator follows that of the `fmod` function in C and `T` is constrained to floating point data types.
5438+ The result of this operator is the remainder of the division operation `x / y` where `x` and `y` are respective elements of `A` and `B`. The result is exactly the value `x - n * y`, where `n` is `x / y` with its fractional part truncated.
5439+ The returned value has the same sign as `x` (except if `x` is `-0`) and is less or equal to `|y|` in magnitude.
5440+ The following special cases apply when `fmod` is set to `1`:
5441+ - If `x` is `-0` and `y` is greater than zero, either `+0` or `-0` may be returned.
5442+ - If `x` is `±∞` and `y` is not `NaN`, `NaN` is returned.
5443+ - If `y` is `±0` and `x` is not `NaN`, `NaN` should be returned.
5444+ - If `y` is `±∞` and `x` is finite, `x` is returned.
5445+ - If either argument is `NaN`, `NaN` is returned.
54155446
5416- In case of dividend being zero, the results will be platform dependent.
5417-
5418- This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).
5447+ This operator supports **multidirectional (i.e., NumPy-style) broadcasting**; for more details please check [the doc](Broadcasting.md).
54195448
54205449Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<13>`, `SameOperandsAndResultElementType`
54215450
@@ -6817,20 +6846,16 @@ _ONNX QuantizeLinear operation_
68176846The linear quantization operator consumes a high-precision tensor, a scale, and a zero point to compute the
68186847low-precision/quantized tensor. The scale factor and zero point must have the same shape, determining the quantization
68196848granularity. The quantization formula is `y = saturate((x / y_scale) + y_zero_point)`.
6820-
68216849Saturation is done according to:
68226850- uint16: [0, 65535]
68236851- int16: [-32768, 32767]
68246852- uint8: [0, 255]
68256853- int8: [-128, 127]
68266854- uint4: [0, 15]
68276855- int4: [-8, 7]
6828-
68296856For `(x / y_scale)`, it rounds to the nearest even. Refer to https://en.wikipedia.org/wiki/Rounding for details.
6830-
68316857`y_zero_point` and `y` must have the same type. `y_zero_point` is usually not used for quantization to float8 types, but the quantization
68326858formula remains the same for consistency, and the type of the attribute `y_zero_point` still determines the quantization type.
6833-
68346859There are three supported quantization granularities, determined by the shape of `y_scale`.
68356860In all cases, `y_zero_point` must have the same shape as `y_scale`.
68366861- Per-tensor (per-layer) quantization: `y_scale` is a scalar.
@@ -7113,7 +7138,7 @@ TensorProto message and be valid as an output type.
71137138
71147139Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<22>`
71157140
7116- Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
7141+ Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ResultTypeInferenceOpInterface`, ` ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
71177142
71187143Effects: `MemoryEffects::Effect{}`
71197144
@@ -7152,7 +7177,7 @@ TensorProto message.
71527177
71537178Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<22>`
71547179
7155- Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
7180+ Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ResultTypeInferenceOpInterface`, ` ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
71567181
71577182Effects: `MemoryEffects::Effect{}`
71587183
@@ -9270,7 +9295,7 @@ Construct an empty tensor sequence, with given data type.
92709295
92719296Traits: `AlwaysSpeculatableImplTrait`, `OpVersionTrait<11>`
92729297
9273- Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
9298+ Interfaces: `ConditionallySpeculatable`, `NoMemoryEffect (MemoryEffectOpInterface)`, `ResultTypeInferenceOpInterface`, ` ShapeHelperOpInterface`, `ShapeInferenceOpInterface`
92749299
92759300Effects: `MemoryEffects::Effect{}`
92769301
@@ -9417,11 +9442,11 @@ If start axis is omitted, the slice starts from axis 0.
94179442The end axis, if specified, is exclusive (and the returned value will not include the size of that axis).
94189443If the end axis is omitted, the axes upto the last one will be included.
94199444Negative axes indicate counting back from the last axis.
9420- Note that axes will be clamped to the range [0, r-1 ], where r is the
9445+ Note that axes will be clamped to the range [0, r], where r is the
94219446rank of the input tensor if they are out-of-range (after adding r in the case of
94229447negative axis). Thus, specifying any end value > r is equivalent to specifying an end
94239448value of r, and specifying any start value < -r is equivalent to specifying a start
9424- value of 0.
9449+ value of 0. If start > end, the result will be an empty shape.
94259450
94269451Examples:
94279452
0 commit comments