Share via


IReadOnlyTensor<TSelf,T> Interface

Definition

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::Numerics::Tensors::IReadOnlyTensor
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public interface IReadOnlyTensor<TSelf,T> : System.Collections.Generic.IEnumerable<T>, System.Numerics.Tensors.IReadOnlyTensor 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 IReadOnlyTensor
    interface seq<'T>
    interface IEnumerable
Public Interface IReadOnlyTensor(Of TSelf, T)
Implements IEnumerable(Of T), IReadOnlyTensor

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 total number of items in the tensor.

(Inherited from IReadOnlyTensor)
IsEmpty

Gets a value indicating whether this tensor is empty.

(Inherited from IReadOnlyTensor)
IsPinned

Gets a value that indicates whether the underlying buffer is pinned.

(Inherited from IReadOnlyTensor)
Item[ReadOnlySpan<IntPtr>]

Gets a reference to the specified element of the tensor.

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.

(Inherited from IReadOnlyTensor)
Rank

Gets the rank, or number of dimensions, in the tensor.

(Inherited from IReadOnlyTensor)
Strides

Gets the stride of each dimension in the tensor.

(Inherited from IReadOnlyTensor)

Methods

AsReadOnlyTensorSpan()

Creates a new readonly tensor span over the tensor.

AsReadOnlyTensorSpan(ReadOnlySpan<IntPtr>)

Creates a new readonly tensor span over a portion of the tensor starting at a specified position to the end of the tensor.

AsReadOnlyTensorSpan(ReadOnlySpan<NIndex>)

Creates a read-only tensor span for the specified start indexes.

AsReadOnlyTensorSpan(ReadOnlySpan<NRange>)

Creates a new readonly tensor span over a portion of the tensor defined by the specified range.

CopyTo(TensorSpan<T>)

Copies the contents of the tensor into a destination tensor span.

FlattenTo(Span<T>)

Flattens the contents of the tensor into a destination span.

GetEnumerator()

Returns an enumerator that iterates through a collection.

(Inherited from IEnumerable)
GetPinnableReference()

Returns a reference to an object of type T that can be used for pinning.

GetPinnedHandle()

Pins and gets a MemoryHandle to the backing memory.

(Inherited from IReadOnlyTensor)
Slice(ReadOnlySpan<IntPtr>)

Forms a slice out of the current tensor that begins at a specified index.

Slice(ReadOnlySpan<NIndex>)

Slices the tensor using the specified start indexes.

Slice(ReadOnlySpan<NRange>)

Gets a slice out of the current tensor that contains a specified range.

TryCopyTo(TensorSpan<T>)

Attempts to copy the contents of this tensor into a destination tensor span and returns a value to indicate whether or not the operation succeeded.

TryFlattenTo(Span<T>)

Attempts to flatten the contents of this tensor into a destination span and returns a value to indicate whether or not the operation succeeded.

Extension Methods

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Creates a FrozenDictionary<TKey,TValue> from an IEnumerable<T> according to specified key selector function.

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

Creates a FrozenDictionary<TKey,TValue> from an IEnumerable<T> according to specified key selector and element selector functions.

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

Creates a FrozenSet<T> with the specified values.

ToImmutableArray<TSource>(IEnumerable<TSource>)

Creates an immutable array from the specified collection.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

Constructs an immutable dictionary based on some transformation of a sequence.

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key and value comparers.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key comparer.

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Enumerates and transforms a sequence, and produces an immutable dictionary of its contents.

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type.

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

Enumerates a sequence and produces an immutable hash set of its contents.

ToImmutableList<TSource>(IEnumerable<TSource>)

Enumerates a sequence and produces an immutable list of its contents.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key comparer.

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer.

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

Enumerates a sequence and produces an immutable sorted set of its contents.

ToAsyncEnumerable<TSource>(IEnumerable<TSource>)

Creates a new IAsyncEnumerable<T> that iterates through source.

Applies to