ai.onnx.ml - CategoryMapper

CategoryMapper - 1 (ai.onnx.ml)

Version

  • name: CategoryMapper (GitHub)

  • domain: ai.onnx.ml

  • since_version: 1

  • function: False

  • support_level: SupportType.COMMON

  • shape inference: True

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

Summary

Converts strings to integers and vice versa.<br> Two sequences of equal length are used to map between integers and strings, with strings and integers at the same index detailing the mapping.<br> 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.<br> 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 - INTS :

    The integers of the map. This sequence must be the same length as the ‘cats_strings’ sequence.

  • cats_strings - STRINGS :

    The strings of the map. This sequence must be the same length as the ‘cats_int64s’ sequence

  • default_int64 - INT (default is &#39;-1&#39;):

    An integer to use when an input string value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined.

  • default_string - STRING (default is &#39;_Unused&#39;):

    A string to use when an input integer value is not found in the map.<br>One and only one of the ‘default_*’ attributes must be defined.

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 in ( tensor(int64), tensor(string) ):

    The input must be a tensor of strings or integers, either [N,C] or [C].

  • T2 in ( tensor(int64), tensor(string) ):

    The output is a tensor of strings or integers. Its shape will be the same as the input shape.