I try to figure out why the following code doesn’t fuse at all. I notice that the IrParser::registerJitOperator registers only the normal tensor op. Does it mean in-place op cannot be fused?
@torch.jit.script
def calc(exp_avg : Tensor,
exp_avg_sq : Tensor,
beta1 : float,
beta2 : float,
grad : Tensor):
exp_avg.mul_(beta1).add_(grad, alpha=1 - beta1)
exp_avg_sq.mul_(beta2).addcmul_(grad, grad.conj(), value=1 - beta2)