create_contraction_trinary#

nvmath.bindings.cutensor.create_contraction_trinary(
intptr_t handle,
intptr_t desc_a,
mode_a,
int op_a,
intptr_t desc_b,
mode_b,
int op_b,
intptr_t desc_c,
mode_c,
int op_c,
intptr_t desc_d,
mode_d,
int op_d,
intptr_t desc_e,
mode_e,
intptr_t desc_compute,
) intptr_t[source]#

This function allocates a cutensorOperationDescriptor_t object that encodes a tensor contraction of the form .

Parameters:
  • handle (intptr_t) – Opaque handle holding cuTENSOR’s library context.

  • desc_a (intptr_t) – The descriptor that holds the information about the data type, modes and strides of A.

  • mode_a (object) –

    Array with ‘nmode_a’ entries that represent the modes of A. The mode_a[i] corresponds to extent[i] and stride[i] w.r.t. the arguments provided to cutensorInitTensorDescriptor. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • op_a (Operator) – Unary operator that will be applied to each element of A before it is further processed. The original data of this tensor remains unchanged.

  • desc_b (intptr_t) – The descriptor that holds information about the data type, modes, and strides of B.

  • mode_b (object) –

    Array with ‘nmode_b’ entries that represent the modes of B. The mode_b[i] corresponds to extent[i] and stride[i] w.r.t. the arguments provided to cutensorInitTensorDescriptor. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • op_b (Operator) – Unary operator that will be applied to each element of B before it is further processed. The original data of this tensor remains unchanged.

  • desc_c (intptr_t) – The escriptor that holds information about the data type, modes, and strides of C.

  • mode_c (object) –

    Array with ‘nmode_c’ entries that represent the modes of C. The mode_c[i] corresponds to extent[i] and stride[i] w.r.t. the arguments provided to cutensorInitTensorDescriptor. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • op_c (Operator) – Unary operator that will be applied to each element of C before it is further processed. The original data of this tensor remains unchanged.

  • desc_d (intptr_t) – The escriptor that holds information about the data type, modes, and strides of D.

  • mode_d (object) –

    Array with ‘nmode_d’ entries that represent the modes of D. The mode_d[i] corresponds to extent[i] and stride[i] w.r.t. the arguments provided to cutensorInitTensorDescriptor. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • op_d (Operator) – Unary operator that will be applied to each element of D before it is further processed. The original data of this tensor remains unchanged.

  • desc_e (intptr_t) – Array with ‘nmode_e’ entries that represent the modes of E (must be identical to mode_d for now). The mode_e[i] corresponds to extent[i] and stride[i] w.r.t. the arguments provided to cutensorInitTensorDescriptor.

  • mode_e (object) –

    The descriptor that holds information about the data type, modes, and strides of E (must be identical to desc_d for now). It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • desc_compute (intptr_t) – Determines the precision in which this operations is performed.

Returns:

This opaque struct gets allocated and filled with the information that encodes the tensor contraction operation.

Return type:

intptr_t

See also

cutensorCreateContractionTrinary