Jaa


ITensor<TSelf,T> Interface

Definition

Represents a tensor.

generic <typename TSelf, typename T>
 where TSelf : ITensor<TSelf, T>public interface class ITensor : System::Collections::Generic::IEnumerable<T>, System::Numerics::Tensors::IReadOnlyTensor<TSelf, T>
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public interface ITensor<TSelf,T> : System.Collections.Generic.IEnumerable<T>, System.Numerics.Tensors.IReadOnlyTensor<TSelf,T> where TSelf : ITensor<TSelf,T>
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type ITensor<'Self, 'T (requires 'Self :> ITensor<'Self, 'T>)> = interface
    interface IReadOnlyTensor<'Self, 'T (requires 'Self :> ITensor<'Self, 'T>)>
    interface seq<'T>
    interface IEnumerable
Public Interface ITensor(Of TSelf, T)
Implements IEnumerable(Of T), IReadOnlyTensor(Of TSelf, T)

Type Parameters

TSelf

The type that implements this interface.

T

The element type.

Derived
Attributes
Implements

Properties

FlattenedLength

Gets the number of elements in the tensor.

(Inherited from IReadOnlyTensor<TSelf,T>)
IsEmpty

Gets a value that indicates whether the collection is currently empty.

(Inherited from IReadOnlyTensor<TSelf,T>)
IsPinned

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

(Inherited from IReadOnlyTensor<TSelf,T>)
IsReadOnly

Gets a value that idicates whether the collection is read-only.

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.

(Inherited from IReadOnlyTensor<TSelf,T>)
Rank

Gets the number of dimensions in the tensor.

(Inherited from IReadOnlyTensor<TSelf,T>)
Strides

Gets the stride of each dimension in the tensor.

(Inherited from IReadOnlyTensor<TSelf,T>)

Methods

AsReadOnlyTensorSpan()

Creates a read-only tensor span for the entire underlying buffer.

(Inherited from IReadOnlyTensor<TSelf,T>)
AsReadOnlyTensorSpan(ReadOnlySpan<IntPtr>)

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

(Inherited from IReadOnlyTensor<TSelf,T>)
AsReadOnlyTensorSpan(ReadOnlySpan<NIndex>)

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

(Inherited from IReadOnlyTensor<TSelf,T>)
AsReadOnlyTensorSpan(ReadOnlySpan<NRange>)

Creates a read-only tensor span for the specified ranges.

(Inherited from IReadOnlyTensor<TSelf,T>)
AsTensorSpan()

Creates a tensor span for the entire underlying buffer.

AsTensorSpan(ReadOnlySpan<IntPtr>)

Creates a tensor span for the specified start indexes.

AsTensorSpan(ReadOnlySpan<NIndex>)

Creates a tensor span for the specified start indexes.

AsTensorSpan(ReadOnlySpan<NRange>)

Creates a tensor span for the specified ranges.

Clear()

Clears the tensor.

CopyTo(TensorSpan<T>)

Copies the tensor to the specified destination. The destination tensor must be equal to or larger than the source tensor.

(Inherited from IReadOnlyTensor<TSelf,T>)
Create(ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths.

Create(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths and strides.

CreateUninitialized(ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths and strides.

CreateUninitialized(ReadOnlySpan<IntPtr>, ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths and strides. If pinned is true the underlying buffer is created permanently pinned, otherwise the underlying buffer is not pinned. The underlying buffer is not initialized.

Fill(T)

Fills the contents of this tensor with the given value.

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.

(Inherited from IReadOnlyTensor<TSelf,T>)
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 null.

Slice(ReadOnlySpan<IntPtr>)

Slices the tensor using the specified start indexes.

(Inherited from IReadOnlyTensor<TSelf,T>)
Slice(ReadOnlySpan<NIndex>)

Slices the tensor using the specified start indexes.

(Inherited from IReadOnlyTensor<TSelf,T>)
Slice(ReadOnlySpan<NRange>)

Slices the tensor using the specified ranges.

(Inherited from IReadOnlyTensor<TSelf,T>)
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.

(Inherited from IReadOnlyTensor<TSelf,T>)
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.

(Inherited from IReadOnlyTensor<TSelf,T>)

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.

Applies to