Tensor<T>.TryGetSpan 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
TryGetSpan(ReadOnlySpan<NIndex>, Int32, Span<T>) |
Tries to return a span that starts at the specified index and contains the specified number of items. |
TryGetSpan(ReadOnlySpan<NIndex>, Int32, ReadOnlySpan<T>) |
Tries to return a span that starts at the specified index and contains the specified number of items. |
TryGetSpan(ReadOnlySpan<IntPtr>, Int32, ReadOnlySpan<T>) |
Tries to return a span that starts at the specified index and contains the specified number of items. |
TryGetSpan(ReadOnlySpan<IntPtr>, Int32, Span<T>) |
Tries to return a span that starts at the specified index and contains the specified number of items. |
TryGetSpan(ReadOnlySpan<NIndex>, Int32, Span<T>)
- Source:
- Tensor_1.cs
Tries to return a span that starts at the specified index and contains the specified number of items.
public:
virtual bool TryGetSpan(ReadOnlySpan<System::Buffers::NIndex> startIndexes, int length, [Runtime::InteropServices::Out] Span<T> % span);
public bool TryGetSpan(scoped ReadOnlySpan<System.Buffers.NIndex> startIndexes, int length, out Span<T> span);
abstract member TryGetSpan : ReadOnlySpan<System.Buffers.NIndex> * int * Span -> bool
override this.TryGetSpan : ReadOnlySpan<System.Buffers.NIndex> * int * Span -> bool
Public Function TryGetSpan (startIndexes As ReadOnlySpan(Of NIndex), length As Integer, ByRef span As Span(Of T)) As Boolean
Parameters
- startIndexes
- ReadOnlySpan<NIndex>
The index at which the span should start.
- length
- Int32
The desired length of the span to retrieve.
- span
- Span<T>
On successful return, a span that consists of length
elements from the current tensor starting at startIndexes
.
Returns
true
if a span was successfully retrieved; otherwise, false
which indicates length
was invalid.
Implements
Applies to
TryGetSpan(ReadOnlySpan<NIndex>, Int32, ReadOnlySpan<T>)
- Source:
- Tensor_1.cs
Tries to return a span that starts at the specified index and contains the specified number of items.
public:
virtual bool TryGetSpan(ReadOnlySpan<System::Buffers::NIndex> startIndexes, int length, [Runtime::InteropServices::Out] ReadOnlySpan<T> % span);
public bool TryGetSpan(scoped ReadOnlySpan<System.Buffers.NIndex> startIndexes, int length, out ReadOnlySpan<T> span);
abstract member TryGetSpan : ReadOnlySpan<System.Buffers.NIndex> * int * ReadOnlySpan -> bool
override this.TryGetSpan : ReadOnlySpan<System.Buffers.NIndex> * int * ReadOnlySpan -> bool
Public Function TryGetSpan (startIndexes As ReadOnlySpan(Of NIndex), length As Integer, ByRef span As ReadOnlySpan(Of T)) As Boolean
Parameters
- startIndexes
- ReadOnlySpan<NIndex>
The index at which the span should start.
- length
- Int32
The desired length of the span to retrieve.
- span
- ReadOnlySpan<T>
On successful return, a span that consists of length
elements from the current tensor starting at startIndexes
.
Returns
true
if a span was successfully retrieved; otherwise, false
which indicates length
was invalid.
Implements
Applies to
TryGetSpan(ReadOnlySpan<IntPtr>, Int32, ReadOnlySpan<T>)
- Source:
- Tensor_1.cs
Tries to return a span that starts at the specified index and contains the specified number of items.
public:
virtual bool TryGetSpan(ReadOnlySpan<IntPtr> startIndexes, int length, [Runtime::InteropServices::Out] ReadOnlySpan<T> % span);
public bool TryGetSpan(scoped ReadOnlySpan<IntPtr> startIndexes, int length, out ReadOnlySpan<T> span);
abstract member TryGetSpan : ReadOnlySpan<nativeint> * int * ReadOnlySpan -> bool
override this.TryGetSpan : ReadOnlySpan<nativeint> * int * ReadOnlySpan -> bool
Public Function TryGetSpan (startIndexes As ReadOnlySpan(Of IntPtr), length As Integer, ByRef span As ReadOnlySpan(Of T)) As Boolean
Parameters
- startIndexes
-
ReadOnlySpan<nativeint>
The index at which the span should start.
- length
- Int32
The desired length of the span to retrieve.
- span
- ReadOnlySpan<T>
On successful return, a span that consists of length
elements from the current tensor starting at startIndexes
.
Returns
true
if a span was successfully retrieved; otherwise, false
which indicates length
was invalid.
Implements
Applies to
TryGetSpan(ReadOnlySpan<IntPtr>, Int32, Span<T>)
- Source:
- Tensor_1.cs
Tries to return a span that starts at the specified index and contains the specified number of items.
public:
virtual bool TryGetSpan(ReadOnlySpan<IntPtr> startIndexes, int length, [Runtime::InteropServices::Out] Span<T> % span);
public bool TryGetSpan(scoped ReadOnlySpan<IntPtr> startIndexes, int length, out Span<T> span);
abstract member TryGetSpan : ReadOnlySpan<nativeint> * int * Span -> bool
override this.TryGetSpan : ReadOnlySpan<nativeint> * int * Span -> bool
Public Function TryGetSpan (startIndexes As ReadOnlySpan(Of IntPtr), length As Integer, ByRef span As Span(Of T)) As Boolean
Parameters
- startIndexes
-
ReadOnlySpan<nativeint>
The index at which the span should start.
- length
- Int32
The desired length of the span to retrieve.
- span
- Span<T>
On successful return, a span that consists of length
elements from the current tensor starting at startIndexes
.
Returns
true
if a span was successfully retrieved; otherwise, false
which indicates length
was invalid.