Table of Contents

Class TensorPermutation

Namespace
NVMathNet.Tensor
Assembly
NVMath.Net.dll

Tensor permutation (generalised transpose): B[modeB] = alpha · opA(A[modeA]). The B mode labels must be a reordering of the A mode labels.

public sealed class TensorPermutation : TensorOperation, IAsyncDisposable, IDisposable

Inheritance

Implements

Inherited Members

Constructors

TensorPermutation(long[], int[], int[], TensorDataType, CuTensorOperator, TensorContractionOptions?, CudaStream?)

Creates a permutation operation.

public TensorPermutation(long[] extentA, int[] modeA, int[] modeB, TensorDataType dataType = TensorDataType.Float32, CuTensorOperator opA = CuTensorOperator.Identity, TensorContractionOptions? options = null, CudaStream? stream = null)

Parameters

extentA long[]

Sizes of the dimensions of A.

modeA int[]

Mode labels of A.

modeB int[]

Mode labels of B: the same labels as modeA in the desired order.

dataType TensorDataType

Element type of both tensors. Default: float.

opA CuTensorOperator

Unary operator applied to each element of A. Default: identity.

options TensorContractionOptions?

Options; null uses defaults.

stream CudaStream?

Optional external stream.

Methods

Execute(nint, nint, double)

Executes B = alpha · opA(permute(A)) on device pointers.

public void Execute(nint pA, nint pB, double alpha = 1)

Parameters

pA nint
pB nint
alpha double

ExecuteAsync(nint, nint, double, CancellationToken)

Asynchronous version of NVMathNet.Tensor.TensorPermutation.Execute(System.IntPtr,System.IntPtr,System.Double); completes when the GPU work is done if Blocking is set.

public Task ExecuteAsync(nint pA, nint pB, double alpha = 1, CancellationToken ct = default)

Parameters

pA nint
pB nint
alpha double
ct CancellationToken

Returns

Task

ExecuteAsync<T>(DeviceBuffer<T>, DeviceBuffer<T>, double, CancellationToken)

Executes B = alpha · opA(permute(A)) on device pointers.

public Task ExecuteAsync<T>(DeviceBuffer<T> a, DeviceBuffer<T> b, double alpha = 1, CancellationToken ct = default) where T : unmanaged, INumberBase<T>

Parameters

a DeviceBuffer<T>
b DeviceBuffer<T>
alpha double
ct CancellationToken

Returns

Task

Type Parameters

T