(x)
return jnp.where(jnp.isnan(x), 0., x)
Replaces NaN values with zeros.

  A support function replaces NaN values with zeros to escape
  the undefined behavior of the division by zero.

  Args:
    x: tensor with arbitrary shape.

  Returns:
    Array with NaNs replaced with 0.
Replaces NaN values with zeros.
Replaces NaN values with zeros .
def _non_nan(x):  # pylint: disable=invalid-name
  """Replaces NaN values with zeros.

  A support function replaces NaN values with zeros to escape
  the undefined behavior of the division by zero.

  Args:
    x: tensor with arbitrary shape.

  Returns:
    Array with NaNs replaced with 0.
  """
  return jnp.where(jnp.isnan(x), 0., x)
def _non_nan ( x ) : # pylint: disable=invalid-name return jnp . where ( jnp . isnan ( x ) , 0. , x )