code: def from_axis_angle(
      axis: type_alias.TensorLike,
      angle: type_alias.TensorLike,
      name: str = "quaternion_from_axis_angle",
  ) -> tf.Tensor:
      """Converts an axis-angle representation to a quaternion.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        axis: A tensor of shape `[A1, ..., An, 3]`, where the last dimension
          represents a normalized axis.
        angle: A tensor of shape `[A1, ..., An, 1]`, where the last dimension
          represents an angle.
        name: A name for this op that defaults to "quaternion_from_axis_angle".
  
      Returns:
        A tensor of shape `[A1, ..., An, 4]`, where the last dimension represents
        a normalized quaternion.
  
      Raises:
        ValueError: If the shape of `axis` or `angle` is not supported.
      """
      with tf.name_scope(name):
          axis = tf.convert_to_tensor(value=axis)
          angle = tf.convert_to_tensor(value=angle)
  
          shape.check_static(
              tensor=axis, tensor_name="axis", has_dim_equals=(-1, 3)
          )
          shape.check_static(
              tensor=angle, tensor_name="angle", has_dim_equals=(-1, 1)
          )
          shape.compare_batch_dimensions(
              tensors=(axis, angle),
              last_axes=-2,
              broadcast_compatible=True,
          )
          axis = asserts.assert_normalized(axis)
  
          half_angle = 0.5 * angle
          w = tf.cos(half_angle)
          xyz = tf.sin(half_angle) * axis
          return tf.concat((xyz, w), axis=-1)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import List
  from six.moves import range
  import tensorflow
  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 4 for calling a global function with example usage: from_axis_angle(axis, angle, name) and returns: tf