docstr: Create a new Transform3d representing 3D rotation using a rotation
  matrix as the input.
  
  Args:
      R: a tensor of shape (3, 3) or (N, 3, 3)
      orthogonal_tol: tolerance for the test of the orthogonality of R
docstr_tok: ["Create","a","new","Transform3d","representing","3D","rotation","using","a","rotation","matrix","as","the","input",".","Args",":","R",":","a","tensor","of","shape","(","3",",","3",")","or","(","N",",","3",",","3",")","orthogonal_tol",":","tolerance","for","the","test","of","the","orthogonality","of","R"]
code: def __init__(
      self,
      R: torch.Tensor,
      dtype: torch.dtype = torch.float32,
      device: Optional[Device] = None,
      orthogonal_tol: float = 1e-5,
  ) -> None:
      """
      Create a new Transform3d representing 3D rotation using a rotation
      matrix as the input.
  
      Args:
          R: a tensor of shape (3, 3) or (N, 3, 3)
          orthogonal_tol: tolerance for the test of the orthogonality of R
  
      """
      device_ = get_device(R, device)
      super().__init__(device=device_, dtype=dtype)
      if R.dim() == 2:
          R = R[None]
      if R.shape[-2:] != (3, 3):
          msg = "R must have shape (3, 3) or (N, 3, 3); got %s"
          raise ValueError(msg % repr(R.shape))
      R = R.to(device=device_, dtype=dtype)
      if (
          os.environ.get("PYTORCH3D_CHECK_ROTATION_MATRICES", "0")
          == "1"
      ):
          # Note: aten::all_close in the check is computationally slow, so we
          # only run the check when PYTORCH3D_CHECK_ROTATION_MATRICES is on.
          _check_valid_rotation_matrix(R, tol=orthogonal_tol)
      N = R.shape[0]
      mat = torch.eye(4, dtype=dtype, device=device_)
      mat = mat.view(1, 4, 4).repeat(N, 1, 1)
      mat[:, :3, :3] = R
      self._matrix = mat
  
imports: import math
  import os
  import warnings
  from typing import List, Optional, Union
  import torch
  from ..common.datatypes import Device, get_device, make_device
  from ..common.workaround import _safe_det_3x3
  from .rotation_conversions import _axis_angle_rotation
  from .se3 import se3_log_map
label_desc: Use image node_id 1 to create a new Rotate object from inherited base classes: Transform3d with example: obj = Rotate(R, dtype, device, orthogonal_tol)