x35f / unstable_baselines

Re-implementations of SOTA RL algorithms.
128 stars 12 forks source link

PERF: changed the way to register tensors that not require gradients. #39

Closed StepNeverStop closed 2 years ago

StepNeverStop commented 2 years ago

changed the way to register tensor that not require gradients so as to avoid wrong message when needs to calculate gradients manually i.e. by torch.autograd.grad

typoverflow commented 2 years ago

Seems fair. register_buffer should be preferred over register_parameter when hoping to skip training on certain parameters, plus nn.Parameter seems to be a deprecated interface for creating module params. Maybe some code testing is needed. @x35f