code: def rot_mat_to_euler(rot_mats):
      # Calculates rotation matrix to euler angles
      # Careful for extreme cases of eular angles like [0.0, pi, 0.0]
  
      sy = torch.sqrt(
          rot_mats[:, 0, 0] * rot_mats[:, 0, 0]
          + rot_mats[:, 1, 0] * rot_mats[:, 1, 0]
      )
      return torch.atan2(-rot_mats[:, 2, 0], sy)
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os.path
  import pickle
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 3 for calling a global function with example usage: rot_mat_to_euler(rot_mats) and returns: torch