The empty-head fallback was logits.sum() * 0; summing -1e4 masked logits overflows to -inf in FP16 and -inf * 0 is NaN. Return a float32 zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The empty-head fallback was logits.sum() * 0; summing -1e4 masked logits overflows to -inf in FP16 and -inf * 0 is NaN. Return a float32 zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>