提交 5256a161 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!18 remove name arg from gradoperation

Merge pull request !18 from riemann_penn/remove_name_arg_from_gradoperation
......@@ -272,7 +272,7 @@ class BertTrainOneStepCell(nn.Cell):
self.network = network
self.weights = ParameterTuple(network.trainable_params())
self.optimizer = optimizer
self.grad = C.GradOperation('grad', get_by_list=True, sens_param=True)
self.grad = C.GradOperation(get_by_list=True, sens_param=True)
self.sens = sens
self.reducer_flag = False
self.parallel_mode = context.get_auto_parallel_context("parallel_mode")
......@@ -351,8 +351,7 @@ class BertTrainOneStepWithLossScaleCell(nn.Cell):
self.network = network
self.weights = ParameterTuple(network.trainable_params())
self.optimizer = optimizer
self.grad = C.GradOperation('grad',
get_by_list=True,
self.grad = C.GradOperation(get_by_list=True,
sens_param=True)
self.reducer_flag = False
self.allreduce = P.AllReduce()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册