未验证 提交 e6a1e875 编写于 作者: L LielinJiang 提交者: GitHub

Delete incorrect warning message (#30196)

* fix warning and no grad
上级 0a21924a
......@@ -621,6 +621,7 @@ class DynamicGraphAdapter(object):
self._input_info = None
if self._nranks > 1:
dist.init_parallel_env()
stradegy = fluid.dygraph.parallel.ParallelStrategy()
stradegy.nranks = ParallelEnv().nranks
stradegy.local_rank = ParallelEnv().local_rank
......@@ -888,7 +889,6 @@ class Model(object):
# init backend
if fluid.in_dygraph_mode():
dist.init_parallel_env()
self._adapter = DynamicGraphAdapter(self)
else:
self._adapter = StaticGraphAdapter(self)
......@@ -943,6 +943,7 @@ class Model(object):
self._update_inputs()
return loss
@paddle.no_grad()
def eval_batch(self, inputs, labels=None):
"""
Run one evaluating step on a batch of data.
......@@ -994,6 +995,7 @@ class Model(object):
self._update_inputs()
return loss
@paddle.no_grad()
def predict_batch(self, inputs):
"""
Run one predicting step on a batch of data.
......
......@@ -61,7 +61,6 @@ class TestDistTraning(unittest.TestCase):
def test_static_multiple_gpus(self):
device = set_device('gpu')
fluid.enable_dygraph(device)
im_shape = (-1, 1, 28, 28)
batch_size = 128
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册