dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.83k stars 4.62k forks source link

Audit the usage of `scoped` in the Tensor APIs #102266

Closed tannergooding closed 2 weeks ago

tannergooding commented 3 months ago

Work is being done to introduce a Tensor<T> and supporting types. As part of that, there are many APIs that are both taking in some ref or span like type and which also return a ref or span like type or which exist as instance methods on a span like type.

Most of these inputs will never be captured by the underlying or returned span like type and so should be annotated as scoped which restricts the lifetime of the inputs and effectively indicates that the lifetime won't be extended (and therefore won't be captured by a span like type or returned as a ref).

We should, accordingly, audit all the newly introduced APIs and ensure scoped is appropriately provided on the APIs where relevant.

dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @dotnet/area-system-numerics-tensors See info in area-owners.md if you want to be subscribed.

michaelgsharp commented 2 weeks ago

Closing as this has been done.