docstr: Tests whether the `so3_exp_map` is robust to the input vectors
  the norms of which are close to the numerically unstable region
  (vectors with low l2-norms).
docstr_tok: ["Tests","whether","the","`","so3_exp_map","`","is","robust","to","the","input","vectors","the","norms","of","which","are","close","to","the","numerically","unstable","region","(","vectors","with","low","l2-norms",")","."]
code: def test_so3_exp_singularity(self, batch_size: int = 100):
      """
      Tests whether the `so3_exp_map` is robust to the input vectors
      the norms of which are close to the numerically unstable region
      (vectors with low l2-norms).
      """
      # generate random log-rotations with a tiny angle
      log_rot = TestSO3.init_log_rot(batch_size=batch_size)
      log_rot_small = log_rot * 1e-6
      log_rot_small.requires_grad = True
      R = so3_exp_map(log_rot_small)
      # tests whether all outputs are finite
      self.assertTrue(torch.isfinite(R).all())
      # tests whether the gradient is not None and all finite
      loss = R.sum()
      loss.backward()
      self.assertIsNotNone(log_rot_small.grad)
      self.assertTrue(torch.isfinite(log_rot_small.grad).all())
  
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 7 for calling the TestSO3 obj's underlying member method code with example usage: obj.test_so3_exp_singularity(batch_size) without return types