Cutensor: when is the unary operation (defined in the tensor descriptor) applied?

The cutensor documentation reads as following regarding tensor descriptors:

“Then, we create a descriptor for each tensor by providing its data type, order, data type, and element-wise operation. The latter sets an element-wise operation that is applied to that tensor when it is used during computation.”

I am trying to apply sine and cosine functions to the same tensor. However, it’s unclear to me from the above text whether the unary operations defined in the tensor descriptor (e.g. CUTENSOR_OP_SIN) are applied when the tensor is calculated (result of a calculation) or is it applied to the tensor which is the input to the calculation, or both? In this case, I simply need input and output tensors to have the same layout: for example, cutensorPermutation can be used to copy one tensor to another (both tensors having the same layout), and apply unary operations. But should the unary operation be declared in the input tensor or the result tensor?

Unary operations are always taken from the input tensors, i.e. the unary operation for the permutation operation comes from the input tensor. the unary operation of the output tensor has no effect.