[API Proposal]: Tensor.LengthsAsInt/Long #111963
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.Numerics.Tensors
untriaged
New issue has not been triaged by the area owner
Background and motivation
Our
Tensor
class has ourLengths
stored asnints
. This allows us to support multi-dimensional tensors that have more total elements thanInt.MaxValue
. Unfortunately, this also makes it harder to do integrations with other frameworks as most (if not all) other frameworks use eitherints
orlongs
to store the lengths of their dimensions. This means our users have to write their own conversion whenever they need to use this.API Proposal
API Usage
Alternative Designs
This could either be stored as actual values or computed each time. I think it would be better to compute it each time, especially in the case of
TensorSpan
where we are being stack memory conscience, rather than store the converted values.Risks
This would be a new api in a preview object, so the risks are very minimal.
The text was updated successfully, but these errors were encountered: