create_elementwise_trinary#

nvmath.bindings.cutensor.create_elementwise_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_ab,
int op_abc,
intptr_t desc_compute,
) intptr_t[source]#

This function creates an operation descriptor that encodes an elementwise trinary operation.

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

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

  • mode_a (object) –

    Array (in host memory) of size desc_a->numModes that holds the names of the modes of A (e.g., if then mode_a = {‘a’,’b’,’c’}). The mode_a[i] corresponds to extent[i] and stride[i] w.r.t. the arguments provided to cutensorCreateTensorDescriptor. 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) – A descriptor that holds information about the data type, modes, and strides of B.

  • mode_b (object) –

    Array (in host memory) of size desc_b->numModes that holds the names of the modes of B. mode_b[i] corresponds to extent[i] and stride[i] of the cutensorCreateTensorDescriptor. 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) – A descriptor that holds information about the data type, modes, and strides of C.

  • mode_c (object) –

    Array (in host memory) of size desc_c->numModes that holds the names of the modes of C. The mode_c[i] corresponds to extent[i] and stride[i] of the cutensorCreateTensorDescriptor. 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) – A descriptor that holds information about the data type, modes, and strides of D. Notice that we currently request desc_d and desc_c to be identical.

  • mode_d (object) –

    Array (in host memory) of size desc_d->numModes that holds the names of the modes of D. The mode_d[i] corresponds to extent[i] and stride[i] of the cutensorCreateTensorDescriptor. It can be:

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

    • a Python sequence of int32_t.

  • op_ab (Operator) – Element-wise binary operator (see above).

  • op_abc (Operator) – Element-wise binary operator (see above).

  • 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 requested elementwise operation.

Return type:

intptr_t

See also

cutensorCreateElementwiseTrinary