ReadOnlyTensorSpan<T>.Slice 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
Slice(ReadOnlySpan<NIndex>) |
Returns a reference to specified element of the TensorSpan. |
Slice(ReadOnlySpan<NRange>) |
Forms a slice out of the given span. |
Slice(ReadOnlySpan<IntPtr>) |
Forms a slice out of the current tensor that begins at a specified index. |
Slice(ReadOnlySpan<NIndex>)
- Source:
- ReadOnlyTensorSpan_1.cs
- Source:
- ReadOnlyTensorSpan.cs
Returns a reference to specified element of the TensorSpan.
public:
virtual System::Numerics::Tensors::ReadOnlyTensorSpan<T> Slice(ReadOnlySpan<System::Buffers::NIndex> startIndexes);
public:
System::Numerics::Tensors::ReadOnlyTensorSpan<T> Slice(ReadOnlySpan<System::Buffers::NIndex> startIndexes);
public System.Numerics.Tensors.ReadOnlyTensorSpan<T> Slice(scoped ReadOnlySpan<System.Buffers.NIndex> startIndexes);
abstract member Slice : ReadOnlySpan<System.Buffers.NIndex> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
override this.Slice : ReadOnlySpan<System.Buffers.NIndex> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
member this.Slice : ReadOnlySpan<System.Buffers.NIndex> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
Public Function Slice (startIndexes As ReadOnlySpan(Of NIndex)) As ReadOnlyTensorSpan(Of T)
Parameters
- startIndexes
- ReadOnlySpan<NIndex>
The indexes at which to begin the slice.
Returns
The sliced tensor.
Implements
Exceptions
Any index is less than 0 or greater than or equal to FlattenedLength.
Applies to
Slice(ReadOnlySpan<NRange>)
- Source:
- ReadOnlyTensorSpan_1.cs
- Source:
- ReadOnlyTensorSpan.cs
Forms a slice out of the given span.
public:
virtual System::Numerics::Tensors::ReadOnlyTensorSpan<T> Slice(ReadOnlySpan<System::Buffers::NRange> ranges);
public:
System::Numerics::Tensors::ReadOnlyTensorSpan<T> Slice(ReadOnlySpan<System::Buffers::NRange> ranges);
public System.Numerics.Tensors.ReadOnlyTensorSpan<T> Slice(scoped ReadOnlySpan<System.Buffers.NRange> ranges);
abstract member Slice : ReadOnlySpan<System.Buffers.NRange> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
override this.Slice : ReadOnlySpan<System.Buffers.NRange> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
member this.Slice : ReadOnlySpan<System.Buffers.NRange> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
Public Function Slice (ranges As ReadOnlySpan(Of NRange)) As ReadOnlyTensorSpan(Of T)
Parameters
- ranges
- ReadOnlySpan<NRange>
The ranges for the slice.
Returns
A ReadOnlyTensorSpan<T> based on the provided ranges
.
Implements
Applies to
Slice(ReadOnlySpan<IntPtr>)
- Source:
- ReadOnlyTensorSpan_1.cs
Forms a slice out of the current tensor that begins at a specified index.
public:
virtual System::Numerics::Tensors::ReadOnlyTensorSpan<T> Slice(ReadOnlySpan<IntPtr> startIndexes);
public:
System::Numerics::Tensors::ReadOnlyTensorSpan<T> Slice(ReadOnlySpan<IntPtr> startIndexes);
public System.Numerics.Tensors.ReadOnlyTensorSpan<T> Slice(scoped ReadOnlySpan<IntPtr> startIndexes);
abstract member Slice : ReadOnlySpan<nativeint> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
override this.Slice : ReadOnlySpan<nativeint> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
member this.Slice : ReadOnlySpan<nativeint> -> System.Numerics.Tensors.ReadOnlyTensorSpan<'T>
Public Function Slice (startIndexes As ReadOnlySpan(Of IntPtr)) As ReadOnlyTensorSpan(Of T)
Parameters
- startIndexes
-
ReadOnlySpan<nativeint>
The indexes at which to begin the slice.
Returns
A tensor that consists of all elements of the current tensor from startIndexes
to the end of the tensor.