You can’t apply a function by directly calling its forward method; what that ends up doing is just calling that forward method on the Variable objects, as if it were the forward of a Module, and building a standard autograd graph without ever using the function’s backward implementation.