Open reillyeon opened 17 hours ago
As an additional data point, both LiteRT and Core ML do not directly support applying their transpose operators to a scalar and implementations based on these frameworks will require workarounds. DirectML only supports this operation because transposition is implemented by adjusting the dimensions and strides of a tensor as it is passed between other nodes, which is a no-op for a scalar tensor.
There are a number of operators, such as
transpose()
andreshape()
which are no-ops when applied to a scalar tensor. In addition there are operators likegather()
which expect indices but a scalar doesn't have indices.While implementations can work around this (typically by treating a scalar as a single-element 1D tensor) it seems better to simply disallow these cases which add complexity without adding any expressivity.