Hi Seyeeet!



 seyeeet:

I am not sure if it will automatically make y to have requires_grad=False or not?


Yes, this will work fine.  L1Loss will propagate gradients back
through both of its arguments without issue.
As an aside, stylistically, I would probably write this as
model ((x - y).abs())

To my eye, that’s a little more readable (but it does the same thing).
Best.
K. Frank