Skip to content

Commit 263c584

Browse files
[MRG] Fix instantiation of ValFunction (which raises a warning with 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
1 parent 5861209 commit 263c584

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

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

9+
#### Closed issues
10+
11+
- Bug in instantiating an `autograd` function (`ValFunction`, Issue #337, PR #338)
12+
913
## 0.8.1.0
1014
*December 2021*
1115

ot/backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ def from_numpy(self, a, type_as=None):
13971397

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

1400-
Func = self.ValFunction()
1400+
Func = self.ValFunction
14011401

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

0 commit comments

Comments
 (0)