Share via


ITensor<TSelf,T> Interface

Definition

Represents a tensor.

generic <typename TSelf, typename T>
 where TSelf : ITensor<TSelf, T>public interface class ITensor : System::Numerics::Tensors::IReadOnlyTensor<TSelf, T>, System::Numerics::Tensors::ITensor
public interface ITensor<TSelf,T> : System.Numerics.Tensors.IReadOnlyTensor<TSelf,T>, System.Numerics.Tensors.ITensor where TSelf : ITensor<TSelf,T>, allows ref struct
public interface ITensor<TSelf,T> : System.Numerics.Tensors.IReadOnlyTensor<TSelf,T>, System.Numerics.Tensors.ITensor where TSelf : ITensor<TSelf,T>
type ITensor<'Self, 'T (requires 'Self :> ITensor<'Self, 'T>)> = interface
    interface ITensor
    interface IReadOnlyTensor
    interface IReadOnlyTensor<'Self, 'T (requires 'Self :> ITensor<'Self, 'T>)>
Public Interface ITensor(Of TSelf, T)
Implements IReadOnlyTensor(Of TSelf, T), ITensor

Type Parameters

TSelf

The type that implements this interface.

T

The element type.

Derived
Implements

Properties

FlattenedLength

Gets the total number of items in the tensor.

(Inherited from IReadOnlyTensor)
HasAnyDenseDimensions

Gets a value that indicates whether the current tensor has any dimension span where IsDense is true.

(Inherited from IReadOnlyTensor)
IsDense

Gets a value that indicates whether the current tensor is dense.

(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)
IsReadOnly

Gets a value that indicates whether the tensor is read-only.

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

Gets the value at the specified indexes.

Item[ReadOnlySpan<NIndex>]

Gets the value at the specified indexes.

Item[ReadOnlySpan<NRange>]

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

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.

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

(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 new readonly tensor span over a portion of the tensor defined by the specified range.

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

Creates a new tensor span over the tensor.

AsTensorSpan(ReadOnlySpan<IntPtr>)

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

AsTensorSpan(ReadOnlySpan<NIndex>)

Creates a tensor span for the specified start indexes.

AsTensorSpan(ReadOnlySpan<NRange>)

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

Clear()

Clears the contents of the tensor span.

(Inherited from ITensor)
CopyTo(TensorSpan<T>)

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

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

Creates a new tensor with the specified lengths.

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

Creates a new tensor with the specified lengths and strides.

CreateFromShapeUninitialized(ReadOnlySpan<IntPtr>, Boolean)

Creates a new tensor with the specified lengths and strides.

CreateFromShapeUninitialized(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(Object)

Fills the elements of this tensor with a specified value.

(Inherited from ITensor)
Fill(T)

Fills the contents of this tensor with the given value.

FlattenTo(Span<T>)

Flattens the contents of the tensor into a destination span.

(Inherited from IReadOnlyTensor<TSelf,T>)
GetDimensionSpan(Int32)

Returns a span that can be used to access the flattened elements for a given dimension.

GetPinnableReference()

Returns a reference to the 0th element of the tensor. If the tensor is empty, returns null.

GetSpan(ReadOnlySpan<IntPtr>, Int32)

Return a span that starts at the specified index and contains the specified number of items.

GetSpan(ReadOnlySpan<NIndex>, Int32)

Return a span that starts at the specified index and contains the specified number of items.

Slice(ReadOnlySpan<IntPtr>)

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

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

Slices the tensor using the specified start indexes.

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

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

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

Creates a dense tensor from the elements of the current tensor.

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

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

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

Tries to return a span that starts at the specified index and contains the specified number of items.

(Inherited from IReadOnlyTensor<TSelf,T>)
TryGetSpan(ReadOnlySpan<IntPtr>, Int32, Span<T>)

Tries to return a span that starts at the specified index and contains the specified number of items.

TryGetSpan(ReadOnlySpan<NIndex>, Int32, ReadOnlySpan<T>)

Tries to return a span that starts at the specified index and contains the specified number of items.

(Inherited from IReadOnlyTensor<TSelf,T>)
TryGetSpan(ReadOnlySpan<NIndex>, Int32, Span<T>)

Tries to return a span that starts at the specified index and contains the specified number of items.

Applies to