[GraphKernel] bert-crf enable graph kernel.

This commit is contained in:
chenlei_autodiff 2021-06-01 11:23:00 +08:00
parent ccee6de15f
commit e4b47e7193
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.")