MCPcopy Create free account
hub / github.com/MotrixLab/insactor / random_rotation

Function random_rotation

data/rotation_utils/conversions.py:359–373  ·  view source on GitHub ↗

Generate a single random 3x3 rotation matrix. Args: dtype: Type to return device: Device of returned tensor. Default: if None, uses the current device for the default tensor type Returns: Rotation matrix as tensor of shape (3, 3).

(
    dtype: Optional[torch.dtype] = None, device: Optional[int] = None
)

Source from the content-addressed store, hash-verified

357
358
359def random_rotation(
360 dtype: Optional[torch.dtype] = None, device: Optional[int] = None
361) -> torch.Tensor:
362 """
363 Generate a single random 3x3 rotation matrix.
364
365 Args:
366 dtype: Type to return
367 device: Device of returned tensor. Default: if None,
368 uses the current device for the default tensor type
369
370 Returns:
371 Rotation matrix as tensor of shape (3, 3).
372 """
373 return random_rotations(1, dtype, device)[0]
374
375
376

Callers

nothing calls this directly

Calls 1

random_rotationsFunction · 0.85

Tested by

no test coverage detected