warp
warp copied to clipboard
[BUG] Updating `requires_grad` on an array in a struct can lead to an access violation
Bug Description
Doing the following:
model.shape_geo.scale.requires_grad = False
model.shape_geo.thickness.requires_grad = False
Causes the gradient arrays for scale and thickness to be garbage collected, however the model.shape_geo struct instead still has a reference to the underlying pointer (in its ctypes struct definition).
When used in the backward pass kernels will attempt to write to the now deallocated memory.
This can be reproduced by running test_sphere_pushing_on_rails_d6 in debug mode on CPU.
System Information
No response