Tensor.AsReadOnlyTensorSpan<T>(T[], ReadOnlySpan<IntPtr>) Method
In this article
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Extension method to more easily create a TensorSpan from an array.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static System::Numerics::Tensors::ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan(cli::array <T> ^ array, ReadOnlySpan<IntPtr> lengths);
C#
public static System.Numerics.Tensors.ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan<T>(this T[]? array, scoped ReadOnlySpan<IntPtr> lengths);
static member AsReadOnlyTensorSpan : 'T[] * ReadOnlySpan<nativeint> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
<Extension()>
Public Function AsReadOnlyTensorSpan(Of T) (array As T(), lengths As ReadOnlySpan(Of IntPtr)) As ReadOnlyTensorSpan(Of T)
- T
The type of the elements in the array
- array
- T[]
The Array with the data
- lengths
-
ReadOnlySpan<nativeint>
The shape for the TensorSpan<T>
Applies to
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: