Hi Ashima!
The reported shape of the tensor, [100, 3]
, can be a useful hint – see
below.
For some explanation about how inplace-modification errors occur and
some techniques to debug them, see this post:
You can sometimes “automatically” fix such errors by using pytorch’s
sweep-inplace-modification-errors-under-the-rug context manager, but
it’s probably good practice to track down and understand the cause of
the error, even if you do use this solution.
It’s quite possible that the shape-[100, 3]
tensor reported in the error
message is self.f[0].weight
(that is, Linear (3. l).weight
). You
are probably training your NeuralODE
and you should be aware that calling
optimizer.step()
on your model will modify that Linear (3. l).weight
inplace. Are you using .backward (retain_graph = True)
anywhere?
Best.
K. Frank