Skip to content

Commit 6ca0583

Browse files
clear differentiation cache in visu_forward to avoid OOM problem (#757)
1 parent 03c693a commit 6ca0583

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/bubble/bubble.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def transform_out(in_, out):
362362
NPOINT_PDE * NTIME_PDE, evenly=True
363363
)
364364

365-
pred_norm = solver.predict(visu_mat, no_grad=False, return_numpy=True)
365+
pred_norm = solver.predict(visu_mat, None, 4096, no_grad=False, return_numpy=True)
366366
# inverse normalization
367367
p_pred = pred_norm["p"].reshape([NTIME_PDE, NPOINT_PDE]).T
368368
u_pred = pred_norm["u"].reshape([NTIME_PDE, NPOINT_PDE]).T

ppsci/utils/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def visu_forward(
185185
for name, expr in expr_dict.items():
186186
output_dict[name] = expr(data_dict)
187187

188-
# clear differentiation cache
189-
clear()
188+
# clear differentiation cache
189+
clear()
190190

191191
return output_dict

0 commit comments

Comments
 (0)