unravel_3d

torch_sim.transforms.unravel_3d(idx_linear, shape)[source]

Convert linear indices back into 3D indices for an array of given shape.

This function takes linear indices, which are used to reference elements in a flattened array, and converts them back into 3D indices. The conversion is based on the provided shape of the array.

Parameters:
  • idx_linear (Tensor) – A tensor of shape [-1] representing the linear indices to be converted.

  • shape (Tensor) – A tensor of shape [3] representing the dimensions of the array.

Returns:

A tensor of shape [-1, 3]

containing the 3D indices corresponding to the input linear indices.

Return type:

Tensor