ravel_3d

torch_sim.transforms.ravel_3d(idx_3d, shape)[source]

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

This function takes 3D indices, which are typically used to reference elements in a 3D array, and converts them into linear indices. The linear index is calculated based on the provided shape of the array, allowing for easy access to elements in a flattened representation.

Parameters:
  • idx_3d (Tensor) – A tensor of shape [-1, 3] representing the 3D indices to be converted.

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

Returns:

A tensor containing the linear indices

corresponding to the input 3D indices.

Return type:

Tensor