module onnxrt.ops_cpu.op_non_zero#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_non_zero

Short summary#

module mlprodict.onnxrt.ops_cpu.op_non_zero

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

NonZero

NonZero ======= Returns the indices of the elements that are non-zero (in row-major order - by dimension). NonZero behaves …

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

_run

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_non_zero.NonZero(onnx_node, desc=None, **options)#

Bases: OpRun


Returns the indices of the elements that are non-zero (in row-major order - by dimension). NonZero behaves similar to numpy.nonzero: https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html, but for scalar input, NonZero produces output shape (0, N) instead of (1, N), which is different from Numpy’s behavior.

Inputs

  • X (heterogeneous)T: input

Outputs

  • Y (heterogeneous)tensor(int64): output

Type Constraints

  • T tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128): Constrain to all tensor types.

Version

Onnx name: NonZero

This version of the operator has been available since version 13.

Runtime implementation: NonZero

__init__(onnx_node, desc=None, **options)#
_run(x, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub