module onnxrt.ops_cpu.op_mod
#
Short summary#
module mlprodict.onnxrt.ops_cpu.op_mod
Runtime operator.
Classes#
class |
truncated documentation |
---|---|
Mod === Performs element-wise binary modulus (with Numpy-style broadcasting support). The sign of the remainder is the … |
Properties#
property |
truncated documentation |
---|---|
|
Returns the list of arguments as well as the list of parameters with the default values (close to the signature). … |
|
Returns the list of modified parameters. |
|
Returns the list of optional arguments. |
|
Returns the list of optional arguments. |
|
Returns all parameters in a dictionary. |
Methods#
method |
truncated documentation |
---|---|
Documentation#
Runtime operator.
- class mlprodict.onnxrt.ops_cpu.op_mod.Mod(onnx_node, desc=None, **options)#
Bases:
OpRun
===
- Performs element-wise binary modulus (with Numpy-style broadcasting support).
The sign of the remainder is the same as that of the Divisor.
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 (in contrast to integer mod). To force a behavior like numpy.fmod() an ‘fmod’ Attribute is provided. This attribute is set to 0 by default causing the behavior to be like integer mod. Setting this attribute to 1 causes the remainder to be calculated similar to that of numpy.fmod().
If the input type is floating point, then fmod attribute must be set to 1.
In case of dividend being zero, the results will be platform dependent.
This operator supports multidirectional (i.e., Numpy-style) broadcasting; for more details please check Broadcasting in ONNX.
Attributes
fmod: Whether the operator should behave like fmod (default=0 meaning it will do integer mods); Set this to 1 to force fmod treatment Default value is
namefmodi0typeINT
(INT)
Inputs
A (heterogeneous)T: Dividend tensor
B (heterogeneous)T: Divisor tensor
Outputs
C (heterogeneous)T: Remainder tensor
Type Constraints
T tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16): Constrain input and output types to high-precision numeric tensors.
Version
Onnx name: Mod
This version of the operator has been available since version 13.
Runtime implementation:
Mod
- __init__(onnx_node, desc=None, **options)#
- _run(a, b, attributes=None, verbose=0, fLOG=None)#
Should be overwritten.
- to_python(inputs)#
Returns a python code equivalent to this operator.
- Parameters:
inputs – inputs name
- Returns:
imports, python code, both as strings