code: def hamming_distance(
      actuals: TensorLike, predictions: TensorLike
  ) -> tf.Tensor:
      """Computes hamming distance.
  
      Hamming distance is for comparing two binary strings.
      It is the number of bit positions in which two bits
      are different.
  
      Args:
          actuals: actual target value.
          predictions: predicted value.
  
      Returns:
          hamming distance: float.
  
      Usage:
  
      >>> y_true = np.array([1, 1, 0, 0, 1, 0, 1, 0, 0, 1], dtype=np.int32)
      >>> y_pred = np.array([1, 0, 0, 0, 1, 0, 0, 1, 0, 1], dtype=np.int32)
      >>> hamming_distance(y_true, y_pred).numpy()
      0.3
  
      """
      result = tf.not_equal(actuals, predictions)
      not_eq = tf.reduce_sum(tf.cast(result, tf.float32))
      ham_distance = tf.math.divide_no_nan(not_eq, len(result))
      return ham_distance
  
file_path: addons/tensorflow_addons/metrics/hamming.py
imports: import tensorflow
  from tensorflow_addons.metrics.utils import MeanMetricWrapper
  from tensorflow_addons.utils.types import FloatTensorLike, TensorLike, AcceptableDTypes
  from typeguard import typechecked
  from typing import Union, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: hamming_distance(actuals, predictions) and returns: ham_distance