code: def _max_mask_non_finite(x, axis=-1, keepdims=False, mask=0):
      """Returns `max` or `mask` if `max` is not finite."""
      x = _convert_to_tensor(x)
      if x.size == 0:
          # Return `-inf` if `x` is empty for consistency with `tf.reduce_max`.
          return -np.inf
      m = np.max(x, axis=_astuple(axis), keepdims=keepdims)
      needs_masking = ~np.isfinite(m)
      if needs_masking.ndim > 0:
          m = np.where(needs_masking, mask, m)
      elif needs_masking:
          m = mask
      return m
  
imports: import collections
  import functools
  import numpy
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy.numpy_array import _reverse
  from tensorflow_probability.python.internal.backend.numpy.numpy_array import one_hot
  from tensorflow_probability.python.internal.backend.numpy.ops import _convert_to_tensor
label_desc: Use image node_id 11 for calling a global function with example usage: _max_mask_non_finite(x, axis, keepdims, mask) and returns: m, unknown