We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d80937 commit 473dfdeCopy full SHA for 473dfde
tests/metrics/test_metric.py
@@ -25,6 +25,7 @@ def update(self):
25
def compute(self):
26
pass
27
28
+
29
class DummyList(Metric):
30
name = "DummyList"
31
@@ -38,6 +39,7 @@ def update(self):
38
39
40
41
42
43
def test_inherit():
44
a = Dummy()
45
@@ -91,7 +93,7 @@ class A(Dummy):
91
93
92
94
class B(DummyList):
95
-
96
97
a = A()
98
assert a.x == 0
99
a.x = torch.tensor(5)
@@ -104,6 +106,7 @@ class B(DummyList):
104
106
b.reset()
105
107
assert isinstance(b.x, list) and len(b.x) == 0
108
109
110
def test_update():
111
class A(Dummy):
112
def update(self, x):
0 commit comments