Solved by Krish in post #8 
              
              
                Had a missing line of code above. This 
def forward(self, x):
    self.some_function()
...

The values of kernel won’t be optimised directly, instead the optimizer will optimise values of var1 and var2 only as they are the parameters. 
You can check that out by tracing the grad_fn backwards (tedious…