code: def from_quaternion(
      quaternion: type_alias.TensorLike,
      name: str = "axis_angle_from_quaternion",
  ) -> Tuple[tf.Tensor, tf.Tensor]:
      """Converts a quaternion to an axis-angle representation.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        quaternion: A tensor of shape `[A1, ..., An, 4]`, where the last dimension
          represents a normalized quaternion.
        name: A name for this op that defaults to "axis_angle_from_quaternion".
  
      Returns:
        Tuple of two tensors of shape `[A1, ..., An, 3]` and `[A1, ..., An, 1]`,
        where the first tensor represents the axis, and the second represents the
        angle. The resulting axis is a normalized vector.
  
      Raises:
        ValueError: If the shape of `quaternion` is not supported.
      """
      with tf.name_scope(name):
          quaternion = tf.convert_to_tensor(value=quaternion)
  
          shape.check_static(
              tensor=quaternion,
              tensor_name="quaternion",
              has_dim_equals=(-1, 4),
          )
          quaternion = asserts.assert_normalized(quaternion)
  
          # This prevents zero norm xyz and zero w, and is differentiable.
          quaternion += asserts.select_eps_for_addition(
              quaternion.dtype
          )
          xyz, w = tf.split(quaternion, (3, 1), axis=-1)
          norm = tf.norm(tensor=xyz, axis=-1, keepdims=True)
          angle = 2.0 * tf.atan2(norm, tf.abs(w))
          axis = safe_ops.safe_unsigned_div(
              safe_ops.nonzero_sign(w) * xyz, norm
          )
          return axis, angle
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Tuple
  import tensorflow
  from tensorflow_graphics.geometry.transformation import quaternion
  from tensorflow_graphics.geometry.transformation import rotation_matrix_3d
  from tensorflow_graphics.math import vector
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import safe_ops
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 3 for calling a global function with example usage: from_quaternion(quaternion, name) and returns: axis,  angle