This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
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 tensor.
generic <typename T>public ref class Tensor sealed : System::Collections::Generic::IEnumerable<T>, System::Numerics::Tensors::IReadOnlyTensor<System::Numerics::Tensors::Tensor<T> ^, T>, System::Numerics::Tensors::ITensor<System::Numerics::Tensors::Tensor<T> ^, T>
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]public sealed class Tensor<T> : System.Collections.Generic.IEnumerable<T>, System.Numerics.Tensors.IReadOnlyTensor<System.Numerics.Tensors.Tensor<T>,T>, System.Numerics.Tensors.ITensor<System.Numerics.Tensors.Tensor<T>,T>
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5001", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]type Tensor<'T> = class interface ITensor<Tensor<'T>, 'T> interface ITensor interface IReadOnlyTensor interface IReadOnlyTensor<Tensor<'T>, 'T> interface seq<'T> interface IEnumerable
Public NotInheritable Class Tensor(Of T)Implements IEnumerable(Of T), IReadOnlyTensor(Of Tensor(Of T), T), ITensor(Of Tensor(Of T), T)
Empty | Gets an empty tensor. |
FlattenedLength | The number of items in theTensor<T>. |
HasAnyDenseDimensions | Determines if the current tensor has any dimension where |
IsDense | Determines if the current tensor is dense. |
IsEmpty | Gets a value indicating whether thisTensor<T> is empty. |
IsPinned | Gets a value indicating whether the backing memory of theTensor<T> is pinned."/> |
Item[ReadOnlySpan<IntPtr>] | Returns a reference to specified element of the Tensor. |
Item[ReadOnlySpan<NIndex>] | Returns a reference to specified element of the Tensor. |
Item[ReadOnlySpan<NRange>] | Returns a slice of the Tensor. |
Lengths | Gets the length of each dimension in thisTensor<T>. |
Rank | Gets a value indicating the rank, or number of dimensions, of thisTensor<T>. |
Strides | Gets the strides of each dimension in thisTensor<T>. |
AsReadOnlyTensorSpan() | Converts thisTensor<T> to aReadOnlyTensorSpan<T> pointing to the same backing memory."/> |
AsReadOnlyTensorSpan(ReadOnlySpan<IntPtr>) | Converts thisTensor<T> to aReadOnlyTensorSpan<T> pointing to the same backing memory based on the provided start locations."/> |
AsReadOnlyTensorSpan(ReadOnlySpan<NIndex>) | Converts thisTensor<T> to aReadOnlyTensorSpan<T> pointing to the same backing memory based on the provided start indexes."/> |
AsReadOnlyTensorSpan(ReadOnlySpan<NRange>) | Converts thisTensor<T> to aReadOnlyTensorSpan<T> pointing to the same backing memory based on the provided ranges."/> |
AsTensorSpan() | Converts thisTensor<T> to aTensorSpan<T> pointing to the same backing memory."/> |
AsTensorSpan(ReadOnlySpan<IntPtr>) | Converts thisTensor<T> to aTensorSpan<T> pointing to the same backing memory based on the provided start locations."/> |
AsTensorSpan(ReadOnlySpan<NIndex>) | Converts thisTensor<T> to aTensorSpan<T> pointing to the same backing memory based on the provided start indexes."/> |
AsTensorSpan(ReadOnlySpan<NRange>) | Converts thisTensor<T> to aTensorSpan<T> pointing to the same backing memory based on the provided ranges."/> |
Clear() | Clears the contents of this tensor. |
CopyTo(TensorSpan<T>) | Copies the contents of the tensor into a destination tensor span. |
Fill(T) | Fills the contents of this span with the given value. |
FlattenTo(Span<T>) | Flattens the contents of this Tensor into the providedSpan<T>. |
GetDimensionSpan(Int32) | Returns a span that can be used to access the flattened elements for a given dimension. |
GetEnumerator() | Gets an enumerator for the readonly tensor. |
GetPinnableReference() | Returns a reference to the 0th element of the Tensor. If the Tensor is empty, returns null reference.It can be used for pinning and is required to support the use of Tensor within a fixed statement. |
GetPinnedHandle() | Pins and gets aMemoryHandle to the backing memory. |
Slice(ReadOnlySpan<IntPtr>) | Forms a slice out of the given tensor |
Slice(ReadOnlySpan<NIndex>) | Forms a slice out of the given tensor |
Slice(ReadOnlySpan<NRange>) | Forms a slice out of the given tensor |
ToDenseTensor() | Creates a dense tensor from the elements of the current tensor. |
ToString(ReadOnlySpan<IntPtr>) | Creates aString representation of theTensorSpan<T>."/> |
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>) | Flattens the contents of this Tensor into the providedSpan<T>. |
Implicit(T[] to Tensor<T>) | |
Implicit(Tensor<T> to ReadOnlyTensorSpan<T>) | |
Implicit(Tensor<T> to TensorSpan<T>) |
ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>) | Creates aFrozenDictionary<TKey,TValue> from anIEnumerable<T> according to specified key selector function. |
ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>) | Creates aFrozenDictionary<TKey,TValue> from anIEnumerable<T> according to specified key selector and element selector functions. |
ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>) | Creates aFrozenSet<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 newIAsyncEnumerable<T> that iterates through |
BroadcastTo<T>(Tensor<T>, TensorSpan<T>) | Broadcast the data from |
PermuteDimensions<T>(Tensor<T>, ReadOnlySpan<Int32>) | Swaps the dimensions of the |
Reshape<T>(Tensor<T>, ReadOnlySpan<IntPtr>) | Reshapes the |
SetSlice<T>(Tensor<T>, ReadOnlyTensorSpan<T>, ReadOnlySpan<NRange>) | Sets a slice of the given |
Squeeze<T>(Tensor<T>) | Removes all dimensions of length one from the |
SqueezeDimension<T>(Tensor<T>, Int32) | Removes axis of length one from the |
ToString<T>(Tensor<T>, ReadOnlySpan<IntPtr>) | |
TryBroadcastTo<T>(Tensor<T>, TensorSpan<T>) | Broadcast the data from |
Unsqueeze<T>(Tensor<T>, Int32) | Insert a new dimension of length 1 that will appear at the dimension position. |
Was this page helpful?
Was this page helpful?