IReadOnlyTensor<TSelf,T>.GetSpan Method
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.
Overloads
GetSpan(ReadOnlySpan<IntPtr>, Int32) |
Return a span that starts at the specified index and contains the specified number of items. |
GetSpan(ReadOnlySpan<NIndex>, Int32) |
Return a span that starts at the specified index and contains the specified number of items. |
GetSpan(ReadOnlySpan<IntPtr>, Int32)
- Source:
- IReadOnlyTensor_1.cs
Return a span that starts at the specified index and contains the specified number of items.
public:
ReadOnlySpan<T> GetSpan(ReadOnlySpan<IntPtr> startIndexes, int length);
public ReadOnlySpan<T> GetSpan(scoped ReadOnlySpan<IntPtr> startIndexes, int length);
abstract member GetSpan : ReadOnlySpan<nativeint> * int -> ReadOnlySpan<'T>
Public Function GetSpan (startIndexes As ReadOnlySpan(Of IntPtr), length As Integer) As ReadOnlySpan(Of T)
Parameters
- startIndexes
-
ReadOnlySpan<nativeint>
The index at which the span should start.
- length
- Int32
The length for the span to return.
Returns
A span that consists of length
elements from the current tensor starting at startIndexes
.
Exceptions
startIndexes
does not contain Rank elements.
length
is negative, greater than FlattenedLength, or would cause the span to contain elements that should be skipped due to Strides.
startIndexes
is not a valid index into the tensor.
Applies to
GetSpan(ReadOnlySpan<NIndex>, Int32)
- Source:
- IReadOnlyTensor_1.cs
Return a span that starts at the specified index and contains the specified number of items.
public:
ReadOnlySpan<T> GetSpan(ReadOnlySpan<System::Buffers::NIndex> startIndexes, int length);
public ReadOnlySpan<T> GetSpan(scoped ReadOnlySpan<System.Buffers.NIndex> startIndexes, int length);
abstract member GetSpan : ReadOnlySpan<System.Buffers.NIndex> * int -> ReadOnlySpan<'T>
Public Function GetSpan (startIndexes As ReadOnlySpan(Of NIndex), length As Integer) As ReadOnlySpan(Of T)
Parameters
- startIndexes
- ReadOnlySpan<NIndex>
The index at which the span should start.
- length
- Int32
The length for the span to return.
Returns
A span that consists of length
elements from the current tensor starting at startIndexes
.