提交 5df0f954 编写于 作者: P panyifeng

remove name arg from gradoperation

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