!17474 [GraphKernel] bert-crf enable graph kernel with AdamWeightDecay on GPU.

From: @chenlei_autodiff
Reviewed-by: @ckey_dou,@gaoxiong1,@gaoxiong1,@ckey_dou
Signed-off-by: @gaoxiong1,@ckey_dou
This commit is contained in:
mindspore-ci-bot 2021-06-01 16:37:31 +08:00 committed by Gitee
commit 1635ba91b1
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ def run_ner():
if bert_net_cfg.compute_type != mstype.float32:
logger.warning('GPU only support fp32 temporarily, run with fp32.')
bert_net_cfg.compute_type = mstype.float32
if optimizer_cfg.optimizer == 'AdamWeightDecay' and args_opt.use_crf.lower() == "false":
if optimizer_cfg.optimizer == 'AdamWeightDecay':
context.set_context(enable_graph_kernel=True)
else:
raise Exception("Target error, GPU or Ascend is supported.")