Python wrappers
Public Python APIs implemented by this engine symbol.Element-wise test for NaN values — returns a boolean tensor that is True at every position whose input is NaN.
Not differentiable: returns a detached boolean tensor with no autograd
node, regardless of a->requires_grad().
Math
The IEEE-754 property "NaN does not equal itself" defines the predicate.
Shape
Output shape equals input shape (elementwise).
See Also
isinf_op, isfinite_op, nan_to_num_op.
Parameters
aTensorImplPtrInput tensor of any floating-point dtype. Integer inputs always produce
False since no integer encodes NaN.Returns
TensorImplPtrBoolean tensor with the same shape and device as a; dtype is Dtype::Bool.
Notes
Useful as a guard inside composite reductions (nanmean, nansum)
where NaN-tainted slots must be replaced before accumulation.