Skip to content
Snippets Groups Projects
Commit e6f57061 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Optimize for memory use.

parent 3ca5a973
No related branches found
No related tags found
No related merge requests found
...@@ -74,12 +74,10 @@ def predict_ERA5(net, ERA5_ds, predictand, loss, batch_size=16, **kwargs): ...@@ -74,12 +74,10 @@ def predict_ERA5(net, ERA5_ds, predictand, loss, batch_size=16, **kwargs):
prob = torch.sigmoid(torch.as_tensor(target[:, 0, ...].squeeze(), prob = torch.sigmoid(torch.as_tensor(target[:, 0, ...].squeeze(),
dtype=torch.float32)).numpy() dtype=torch.float32)).numpy()
# shape and scale parameters
shape = target[:, 1, ...].squeeze()
scale = target[:, 2, ...].squeeze()
# precipitation amount # precipitation amount
pr = loss.predict(prob, shape, scale) pr = loss.predict(prob, target[:, 1, ...].squeeze(),
target[:, 2, ...].squeeze())
del target # clear memory
# precipitation probability and amount # precipitation probability and amount
ds = {'prob': prob, 'precipitation': pr} ds = {'prob': prob, 'precipitation': pr}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment