Skip to content

Commit 13991b5

Browse files
authored
fix hapi fleet bug in static mode (#34311)
1 parent 3ea3e90 commit 13991b5

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

python/paddle/hapi/model.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ def _init_context():
218218
fluid.disable_dygraph()
219219
_init_context()
220220
fluid.enable_dygraph(place)
221-
else:
222-
_init_context()
223221

224222
else:
225223
assert ("Only support CUDAPlace for now.")

python/paddle/tests/dist_hapi_mnist_static.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def compute_accuracy(pred, gt):
5959
'CPU testing is not supported')
6060
class TestDistTraning(unittest.TestCase):
6161
def test_static_multiple_gpus(self):
62+
paddle.enable_static()
6263
device = set_device('gpu')
6364

6465
im_shape = (-1, 1, 28, 28)

0 commit comments

Comments
 (0)