ankane / torch.rb

Deep learning for Ruby, powered by LibTorch
Other
704 stars 30 forks source link

.backward() gains retain_graph and create_graph boolean options #8

Closed derrelldurrett closed 4 years ago

derrelldurrett commented 4 years ago

I've tried to follow the behavior of the Python version, in which retain_graph adopts the value of create_graph if create_graph is set.

I didn't create a test for this, as I haven't learned enough about how to use it to know what a good test would do.

ankane commented 4 years ago

Added the new options in 0dabe5a67088957f1e758772a31c3efc812153de. Thanks again for the PR!