xnn.ffnn.models.amoeba_ewald.fusable#

xnn.ffnn.models.amoeba_ewald.fusable(fn)[source]#

Mark a pure function of per-pair tensors for the fused path.

Inside fused() it runs through torch.compile with dynamic sizes, which turns its chain of small elementwise operations into a few generated kernels in the forward and in the backward pass (independent ones merged into shared launches by the inductor’s combo kernels). The first fused call runs eagerly, so evaluations that happen once never pay for the compilation. A compiled function has no double backward: the fused path serves evaluations with first derivatives (molecular dynamics, inference).