The existing spec allows to use negative value to define unknown dimension in an MLOperandDescriptor as
dictionary MLOperandDescriptor {
// The operand type.
required MLOperandType type;
// The dimensions field is only required for tensor operands.
// The negative value means an unknown dimension.
sequence<long> dimensions;
};
However, according to the investigation of native ML APIs used by WebNN-native implementation, this feature is not supported widely. The following table captures some examples for reference:
Given that, I'd like to propose to remove the support of negative dimension values and use unsigned long data type instead.
/cc @yuhonglin, thanks for raising this issue when reviewing a Chromium WebNN CL.
The existing spec allows to use negative value to define unknown dimension in an
MLOperandDescriptorasHowever, according to the investigation of native ML APIs used by WebNN-native implementation, this feature is not supported widely. The following table captures some examples for reference:
size_tUINTuint32_tsize_tsize_tsize_tNSUIntegerGiven that, I'd like to propose to remove the support of negative dimension values and use
unsigned longdata type instead./cc @yuhonglin, thanks for raising this issue when reviewing a Chromium WebNN CL.