From 5a178fe935886c0b305f2d10328cb5cf46232f48 Mon Sep 17 00:00:00 2001 From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu> Date: Fri, 20 Aug 2021 15:17:51 +0200 Subject: [PATCH] Convert to torch tensor. --- climax/core/predict.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/climax/core/predict.py b/climax/core/predict.py index 850bdce..0a135a5 100644 --- a/climax/core/predict.py +++ b/climax/core/predict.py @@ -64,7 +64,9 @@ def predict_ERA5(net, ERA5_ds, predictand, batch_size=16, **kwargs): elif predictand == 'pr': ds = { # probability of precipitation - 'prob': torch.sigmoid(target[:, 0, ...].squeeze()), + 'prob': torch.sigmoid( + torch.as_tensor(target[:, 0, ...].squeeze(), + dtype=torch.float32)).numpy(), # amount of precipitation: expected value of gamma distribution # pr = shape * scale -- GitLab