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, IDisposableInheritance
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
extentAlong[]-
Sizes of the dimensions of A.
modeAint[]-
Mode labels of A.
modeBint[]-
Mode labels of B: the same labels as
modeAin the desired order. dataTypeTensorDataType-
Element type of both tensors. Default: float.
opACuTensorOperator-
Unary operator applied to each element of A. Default: identity.
optionsTensorContractionOptions?-
Options;
nulluses defaults. streamCudaStream?-
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
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
pAnintpBnintalphadoublectCancellationToken
Returns
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
aDeviceBuffer<T>bDeviceBuffer<T>alphadoublectCancellationToken
Returns
Type Parameters
T