ai.onnx.ml - CastMap#
name: CastMap (GitHub)
shape inference: True
This version of the operator has been available since version 1 of domain ai.onnx.ml.
Converts a map to a tensor. The map key must be an int64 and the values will be ordered in ascending order based on this key. The operator supports dense packing or sparse packing. If using sparse packing, the key cannot exceed the max_map-1 value.
cast_to: A string indicating the desired element type of the output tensor, one of ‘TO_FLOAT’, ‘TO_STRING’, ‘TO_INT64’. Default value is
map_form: Indicates whether to only output as many values as are in the input (dense), or position the input based on using the key of the map as the index of the output (sparse).<br>One of ‘DENSE’, ‘SPARSE’. Default value is
max_map: If the value of map_form is ‘SPARSE,’ this attribute indicates the total length of the output tensor. Default value is
X (heterogeneous) - T1: The input map that is to be cast to a tensor
Y (heterogeneous) - T2: A tensor representing the same data as the input map, ordered by their keys
T1 in ( map(int64, float), map(int64, string) ): The input must be an integer map to either string or float.
T2 in ( tensor(float), tensor(int64), tensor(string) ): The output is a 1-D tensor of string, float, or integer.