IReadOnlyTensor<TSelf,T> Interface
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.
Represents a read-only tensor.
generic <typename TSelf, typename T>
where TSelf : IReadOnlyTensor<TSelf, T>public interface class IReadOnlyTensor : System::Collections::Generic::IEnumerable<T>
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public interface IReadOnlyTensor<TSelf,T> : System.Collections.Generic.IEnumerable<T> where TSelf : IReadOnlyTensor<TSelf,T>
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type IReadOnlyTensor<'Self, 'T (requires 'Self :> IReadOnlyTensor<'Self, 'T>)> = interface
interface seq<'T>
interface IEnumerable
Public Interface IReadOnlyTensor(Of TSelf, T)
Implements IEnumerable(Of T)
Type Parameters
- TSelf
The type that implements this interface.
- T
The element type.
- Derived
- Attributes
- Implements
Properties
Empty |
Gets an empty tensor. |
FlattenedLength |
Gets the number of elements in the tensor. |
IsEmpty |
Gets a value that indicates whether the collection is currently empty. |
IsPinned |
Gets a value that indicates whether the underlying buffer is pinned. |
Item[ReadOnlySpan<IntPtr>] |
Gets the value at the specified indexes. |
Item[ReadOnlySpan<NIndex>] |
Gets the value at the specified indexes. |
Item[ReadOnlySpan<NRange>] |
Gets the values at the specified ranges. |
Lengths |
Gets the length of each dimension in the tensor. |
Rank |
Gets the number of dimensions in the tensor. |
Strides |
Gets the stride of each dimension in the tensor. |
Methods
AsReadOnlyTensorSpan() |
Creates a read-only tensor span for the entire underlying buffer. |
AsReadOnlyTensorSpan(ReadOnlySpan<IntPtr>) |
Creates a read-only tensor span for the specified start indexes. |
AsReadOnlyTensorSpan(ReadOnlySpan<NIndex>) |
Creates a read-only tensor span for the specified start indexes. |
AsReadOnlyTensorSpan(ReadOnlySpan<NRange>) |
Creates a read-only tensor span for the specified ranges. |
CopyTo(TensorSpan<T>) |
Copies the tensor to the specified destination. The destination tensor must be equal to or larger than the source tensor. |
FlattenTo(Span<T>) |
Flattens the tensor to the specified destination. The destination span must be equal to or larger than the number of elements in the source tensor. |
GetEnumerator() |
Returns an enumerator that iterates through a collection. (Inherited from IEnumerable) |
GetPinnableReference() |
Returns a reference to the 0th element of the tensor. If the tensor is empty, returns |
Slice(ReadOnlySpan<IntPtr>) |
Slices the tensor using the specified start indexes. |
Slice(ReadOnlySpan<NIndex>) |
Slices the tensor using the specified start indexes. |
Slice(ReadOnlySpan<NRange>) |
Slices the tensor using the specified ranges. |
TryCopyTo(TensorSpan<T>) |
Tries to copy the tensor to the specified destination. The destination tensor must be equal to or larger than the source tensor. |
TryFlattenTo(Span<T>) |
Tries to flatten the tensor to the specified destination. The destination span must be equal to or larger than the number of elements in the source tensor. |
Extension Methods
Applies to
.NET