Skip to content

Commit 254c2d3

Browse files
use no_grad_context_manager to control grad behavior
1 parent 55b5091 commit 254c2d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ppsci/solver/visu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def visualize_func(solver, epoch_id: int):
5959
evaluator.add_target_expr(output_expr, output_key)
6060

6161
# forward
62-
with solver.autocast_context_manager():
62+
with solver.autocast_context_manager(), solver.no_grad_context_manager():
6363
batch_output_dict = evaluator(batch_input_dict)
6464

6565
# collect batch data

0 commit comments

Comments
 (0)