out[i] = in[i] with NaN, +inf and -inf replaced, over n words.
The replacements arrive already in the format's own bits. The caller rounds each double the way a cast to the dtype would (through float for the 16-bit formats, as the reference framework's half types do), so a value the format cannot hold becomes its infinity, as the reference framework's cast makes it. Every other word is copied bit for bit: -0, subnormals and NaN payloads are untouched where they are not replaced.
A complex tensor is passed as its 2 n interleaved parts. Each part
is replaced on its own, which is the reference framework's rule for
complex input.
Parameters
inconst void*n contiguous words.outvoid*n words.nstd::size_tWord count.
nan_ bits, posinf_ bits, neginf_ bitsFormat::WordThe replacements.
grainstd::size_tSmallest chunk handed to another core (cpu::parallel_for).