Open justinormont opened 5 years ago
Indeed there are now 4 and 8 byte unsigned int types in ONNX, see:
We should use them, now that they exist.
@TomFinley : Should we also map BL
to Bool
, or is there a reason behind Float
?
Bool
is available:
https://github.com/dotnet/machinelearning/blob/96439752cbaad099093ca0e8c770576bf3a53ad4/src/Microsoft.ML.Onnx/OnnxMl.cs#L2962-L2964
Current BL
mapping is to Float
:
https://github.com/dotnet/machinelearning/blob/96439752cbaad099093ca0e8c770576bf3a53ad4/src/Microsoft.ML.Onnx/OnnxUtils.cs#L308-L310
We also have map bool to float due to old op signatures. It'd be better to revise the entire framework against the latest ONNX spec.
Currently, for ONNX, we are mapping a
U4
datatype (an unsigned 32-bit integer) to anInt64
.Should we be instead mapping the
U4
datatype toUint32
in ONNX? Or is there no support for aUint32
, and we're storing in anInt64
?https://github.com/dotnet/machinelearning/blob/96439752cbaad099093ca0e8c770576bf3a53ad4/src/Microsoft.ML.Onnx/OnnxUtils.cs#L329-L331
In the above code, you'll notice the mapping is currently:
BL
toFloat
TX
toString
I1
toInt8
U1
toUint8
I2
toInt16
U2
toUint16
I4
toInt32
U4
toInt64
<- This one is oddI8
toInt64
U8
toUint64
R4
toFloat
R8
toDouble
The
BL
toFloat
&U4
toInt64
seem odd.@wschin noted we have been mapping
U4
toInt64
for the last two releases of WinML: https://github.com/dotnet/machinelearning/pull/947#discussion_r223443413