xtensor provides the following functions that deal with NaNs in xexpressions:
Defined in xtensor/core/xmath.hpp
.. doxygengroup:: nan_functions :members: