System.Numerics.Tensor, can't create with > 2G elements
The constructor of Tensor() class takes an int32 value, and thus cannot create large tensor objects.
https://github.com/dotnet/corefx/blob/master/src/System.Numerics.Tensors/src/System/Numerics/Tensors/Tensor.cs#L269
OnnxRuntime depends on System.Numerics.Tensor to score machine learning models, some of which produce quite large tensors. While the native C++ API can handle large tensors produced by some models, the C# API is not able to handle them due to this 2G limitation.
See the corresponding issue below:
https://github.com/Microsoft/onnxruntime/issues/713
The 2b element limitation is a fundamental one in the runtime for both Span<T> and T[].
CC. @jkotas, @danmosemsft
Right. Duplicate of https://github.com/dotnet/coreclr/issues/23132 that has more discussion on this topic.