mlx-examples
mlx-examples copied to clipboard
Checking for nan values in arrays
I have run into a situation where my code continues to run for some time while nan values start to appear in mx arrays. I want to catch this early and do exception handling. In situations like this having the equivalent of NumPy'sisnan()
, e.g.
if mx.any(mx.isnan(u))
would be very handy. I am not sure if something is already available and missed it.