torchref.base.targets.triton.xray_ls module

Triton kernels for the Least-Squares X-ray target.

Supports two weighting modes: ‘sigma’ (1/sigma^2 weights, with the same median-floor as the eager target) and ‘unit’ (all weights = 1).

All scalars (sigma_floor, grad_out) are passed as 0-D device tensors and tl.load``ed in-kernel no host ``.item() syncs.

torchref.base.targets.triton.xray_ls.ls_xray_loss_math_triton(F_obs, F_calc, sigma, mask, weighting='sigma')[source]

Triton-backed least-squares X-ray loss.