Share via


TensorSpan<T>.TryGetSpan Method

Definition

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:
TensorSpan_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(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
member 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:
TensorSpan_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(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
member 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:
TensorSpan_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(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
member 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<IntPtr>

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:
TensorSpan_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(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
member 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<IntPtr>

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.

Implements

Applies to