Skip to content

Commit 216b348

Browse files
authored
Fixed test pearson metric issue with old pytorch versions (#3225)
1 parent 070b71a commit 216b348

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/ignite/metrics/regression/test_pearson_correlation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def update_fn(engine: Engine, batch):
120120
m = PearsonCorrelation()
121121
m.attach(engine, "corr")
122122

123-
np_y = y.ravel().numpy()
124-
np_y_pred = y_pred.ravel().numpy()
123+
np_y = y.numpy().ravel()
124+
np_y_pred = y_pred.numpy().ravel()
125125

126126
data = list(range(y_pred.shape[0] // batch_size))
127127
corr = engine.run(data, max_epochs=1).metrics["corr"]

0 commit comments

Comments
 (0)