code: def double_factorial(n: TensorLike) -> TensorLike:
      """Computes the double factorial of `n`.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        n: A tensor of shape `[A1, ..., An]` containing positive integer values.
  
      Returns:
        A tensor of shape `[A1, ..., An]` containing the double factorial of `n`.
      """
      n = tf.convert_to_tensor(value=n)
  
      two = tf.ones_like(n) * 2
      result = tf.ones_like(n)
      _, result, _ = tf.while_loop(
          cond=_double_factorial_loop_condition,
          body=_double_factorial_loop_body,
          loop_vars=[n, result, two],
      )
      return result
  
file_path: graphics/tensorflow_graphics/math/math_helpers.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  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.type_alias import Float
  from tensorflow_graphics.util.type_alias import TensorLike
label_desc: Use image node_id 4 for calling a global function with example usage: double_factorial(n) and returns: result