Skip to content

Commit

Permalink
switch to O2
Browse files Browse the repository at this point in the history
  • Loading branch information
WilfChen committed Jul 1, 2024
1 parent d6f138e commit 7f55a67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions example/dqn/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def train(episode=options.episode):
if context.get_context('device_target') in ['CPU']:
context.set_context(enable_graph_kernel=True)
context.set_context(mode=context.GRAPH_MODE, ascend_config={"precision_mode": "allow_mix_precision"})
context.set_context(jit_config={"jit_level": "O2"})
compute_type = mstype.float32 if options.precision_mode == 'fp32' else mstype.float16
config.algorithm_config['policy_and_network']['params']['compute_type'] = compute_type
if compute_type == mstype.float16 and options.device_target != 'Ascend':
Expand Down

0 comments on commit 7f55a67

Please sign in to comment.