module onnxrt.ops_cpu.op_category_mapper#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_category_mapper

Short summary#

module mlprodict.onnxrt.ops_cpu.op_category_mapper

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

CategoryMapper

CategoryMapper (ai.onnx.ml) =========================== Converts strings to integers and vice versa. Two sequences of …

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__

_infer_shapes

_infer_sizes

_infer_types

_run

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_category_mapper.CategoryMapper(ai.onnx.ml)#

Bases: OpRun

Converts strings to integers and vice versa.

Two sequences of equal length are used to map between integers and strings, with strings and integers at the same index detailing the mapping.

Each operator converts either integers to strings or strings to integers, depending on which default value attribute is provided. Only one default value attribute should be defined.

If the string default value is set, it will convert integers to strings. If the int default value is set, it will convert strings to integers.

Attributes

  • cats_int64s: The integers of the map. This sequence must be the same length as the ‘cats_strings’ sequence. default value cannot be automatically retrieved (INTS)

  • cats_strings: The strings of the map. This sequence must be the same length as the ‘cats_int64s’ sequence default value cannot be automatically retrieved (STRINGS)

  • default_int64: An integer to use when an input string value is not found in the map. One and only one of the ‘default_*’ attributes must be defined. Default value is namedefaultint64i-1typeINT (INT)

  • default_string: A string to use when an input integer value is not found in the map. One and only one of the ‘default_*’ attributes must be defined. Default value is namedefaultstringsUnusedtypeSTRING (STRING)

Inputs

  • X (heterogeneous)T1: Input data

Outputs

  • Y (heterogeneous)T2: Output data. If strings are input, the output values are integers, and vice versa.

Type Constraints

  • T1 tensor(string), tensor(int64): The input must be a tensor of strings or integers, either [N,C] or [C].

  • T2 tensor(string), tensor(int64): The output is a tensor of strings or integers. Its shape will be the same as the input shape.

Version

Onnx name: CategoryMapper

This version of the operator has been available since version 1 of domain ai.onnx.ml.

Runtime implementation: CategoryMapper

__init__(onnx_node, desc=None, **options)#
_infer_shapes(x)#

Should be overwritten.

source on GitHub

_infer_sizes(*args, **kwargs)#

Should be overwritten.

source on GitHub

_infer_types(x)#

Should be overwritten.

source on GitHub

_run(x, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub