tf.keras.ops.nan_to_num

Replace NaN with zero and infinity with large finite numbers.

x Input data.
nan Optional float or int. Value to replace NaN entries with.
posinf Optional float or int. Value to replace positive infinity with.
neginf Optional float or int. Value to replace negative infinity with.

x, with non-finite values replaced.