Alternatively, you could update the underlying .data.
It’s usually not recommended, but would also work:
self.m.data -= self.m.grad * self.learning_rate
self.b.data -= self.b.grad * self.learning_rate