cuquantum.cutensornet.create_tensor_descriptor

cuquantum.cutensornet.create_tensor_descriptor(intptr_t handle, int32_t num_modes, extents, strides, modes, int data_type) intptr_t[source]

Initializes a cutensornetTensorDescriptor_t, describing the information of a tensor.

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

  • num_modes (int32_t) – The number of modes of the tensor.

  • extents (object) –

    Array of size num_modes; extents[j] corresponding to the extent of the j-th mode of the tensor. It can be:

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

    • a Python sequence of int64_t.

  • strides (object) –

    Array of size num_modes; strides[j] corresponding to the linearized offset – in physical memory – between two logically-neighboring elements w.r.t the j-th mode of the tensor. It can be:

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

    • a Python sequence of int64_t.

  • modes (object) –

    Array of size num_modes; modes[j] denotes the j-th mode of the tensor. It can be:

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

    • a Python sequence of int32_t.

  • data_type (int) – Denotes the data type for the tensor.

Returns

Pointer to a cutensornetTensorDescriptor_t.

Return type

intptr_t