fromDLPack#

Fully qualified name: isaacsim::common::array::fromDLPack

Array isaacsim::common::array::fromDLPack(const DLTensor &tensor)#

Creates an Array view of a DLPack tensor without copying its data.

The tensor must use a supported scalar dtype, reside on a CPU or CUDA device, and be C-contiguous. A null strides pointer is accepted as the conventional representation of a contiguous tensor.

The returned Array borrows the tensor’s data allocation. The owner of tensor must keep the allocation alive for the lifetime of the returned Array and every view derived from it. Shape and dtype metadata are copied.

This function does not perform stream synchronization.

Parameters:

tensor – [in] DLPack tensor to view.

Throws:
  • std::invalid_argument – if the tensor metadata is invalid or unsupported.

  • std::overflow_error – if the tensor rank, element count, or byte offset cannot be represented.

Returns:

An Array that aliases the tensor’s data.