code: def nonzero_sign(
      x: type_alias.TensorLike, name: str = "nonzero_sign"
  ) -> tf.Tensor:
      """Returns the sign of x with sign(0) defined as 1 instead of 0."""
      with tf.name_scope(name):
          x = tf.convert_to_tensor(value=x)
  
          one = tf.ones_like(x)
          return tf.where(tf.greater_equal(x, 0.0), one, -one)
  
file_path: graphics/tensorflow_graphics/util/safe_ops.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Optional
  import numpy
  import tensorflow
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 1 for calling a global function with example usage: nonzero_sign(x, name) and returns: tf