empty_local#

cuquantum.tensornet.experimental.distributed.empty_local(
distribution: BlockCyclic,
global_shape: Sequence[int],
*,
dtype,
like,
rank: int | None = None,
stream=None,
)[source]#

Allocate this rank’s local shard in a compact Fortran-order layout.

Warning

This API is experimental and subject to future changes.

This is the layout the native library currently selects for null element strides and accepts without staging. Arrays allocated here can be passed directly to distributed_decompose(); see get_local_layout() to inspect the expected local shape and element strides without allocating.

Parameters:
  • distribution – The BlockCyclic distribution of the tensor.

  • global_shape – Global extents of the tensor.

  • dtype – Element data type for the allocation.

  • like – An array of the desired package/device (e.g. a CuPy array on the target device).

  • rank – Process rank; defaults to the calling process.

  • stream – Stream the allocation is ordered on (device arrays only); defaults to the package’s current stream.