Skip to content

Commit

Permalink
[MRG] Fix instantiation of ValFunction (which raises a warning with…
Browse files Browse the repository at this point in the history
… PyTorch) (#338)

* Not instantiating `ValFunction`

`ValFunction` should not be instantiated since `autograd` functions are
supposed to only ever use static methods. This solves a warning message
raised by PyTorch.

* Updated release information

* Fixed PR number
  • Loading branch information
Pseudomanifold authored Jan 19, 2022
1 parent 5861209 commit 263c584
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- Better list of related examples in quick start guide with `minigallery` (PR #334)

#### Closed issues

- Bug in instantiating an `autograd` function (`ValFunction`, Issue #337, PR #338)

## 0.8.1.0
*December 2021*

Expand Down
2 changes: 1 addition & 1 deletion ot/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def from_numpy(self, a, type_as=None):

def set_gradients(self, val, inputs, grads):

Func = self.ValFunction()
Func = self.ValFunction

res = Func.apply(val, grads, *inputs)

Expand Down

0 comments on commit 263c584

Please sign in to comment.