docstr: Randomly generate a batch of `batch_size` 3x3 rotation matrices.
docstr_tok: ["Randomly","generate","a","batch","of","`","batch_size","`","3x3","rotation","matrices","."]
code: def init_rot(batch_size: int = 10):
      """
      Randomly generate a batch of `batch_size` 3x3 rotation matrices.
      """
      device = torch.device("cuda:0")
  
      # TODO(dnovotny): replace with random_rotation from random_rotation.py
      rot = []
      for _ in range(batch_size):
          r = torch.linalg.qr(torch.randn((3, 3), device=device))[0]
          f = torch.randint(2, (3,), device=device, dtype=torch.float32)
          if f.sum() % 2 == 0:
              f = 1 - f
          rot.append(r * (2 * f - 1).float())
      rot = torch.stack(rot)
  
      return rot
  
imports: import math
  import unittest
  from distutils.version import LooseVersion
  import numpy
  import torch
  from pytorch3d.transforms.so3 import hat, so3_exp_map, so3_log_map, so3_relative_angle, so3_rotation_angle
  from .common_testing import TestCaseMixin
label_desc: Use image node_id 3 for calling the TestSO3 obj's underlying member method code with example usage: obj.init_rot(batch_size) and returns: rot