flashinfer.cake_mhc_nondet_train.cake_mhc_nondet_train_forward_finish¶
- flashinfer.cake_mhc_nondet_train.cake_mhc_nondet_train_forward_finish(X: Tensor, B: Tensor, stats: Tensor, *, out: Tensor | None = None) Tensor¶
Residual mixing:
Y[t, j, d] = BF16(post[t, j] B[t, d] + sum_i C[t, i, j] X[t, i, d]).The arguments and output are those of
cake_mhc_det_train_forward_finish(); the call runs the backend package (the deterministic package’s bits).- Parameters:
X (torch.Tensor) – BF16
[T, 4, H]contiguous residual streams (theforward_prepareinput).B (torch.Tensor) – BF16
[T, H]contiguous output of the external branch applied toU.stats (torch.Tensor) – FP32
[T, 64]record ofcake_mhc_nondet_train_forward_prepare()(orcake_mhc_nondet_train_forward_stats()).out (torch.Tensor, optional) – Preallocated BF16
[T, 4, H]contiguousY.
- Returns:
BF16
Yof shape[T, 4, H].- Return type:
torch.Tensor