From a7539508c365b6a4b350be3c9f1729f695d14e90 Mon Sep 17 00:00:00 2001 From: zmxdream Date: Wed, 8 Feb 2023 16:44:10 +0800 Subject: [PATCH] [pglbox]hidden unzip (#50292) * hidden unzip * fix * fix --- .../ps/service/simple_rpc/baidu_rpc_server.cc | 9 +++++---- python/paddle/fluid/tests/unittests/test_unzip_op.py | 2 +- python/paddle/incubate/__init__.py | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/distributed/ps/service/simple_rpc/baidu_rpc_server.cc b/paddle/fluid/distributed/ps/service/simple_rpc/baidu_rpc_server.cc index 99cadfc185..f3e501dd00 100644 --- a/paddle/fluid/distributed/ps/service/simple_rpc/baidu_rpc_server.cc +++ b/paddle/fluid/distributed/ps/service/simple_rpc/baidu_rpc_server.cc @@ -110,7 +110,7 @@ class BRpcServiceImpl : public SimpleRpcService { delete head.request; PADDLE_ENFORCE_NE( head.service, - 0, + nullptr, phi::errors::PreconditionNotMet("Service should not be nullptr.")); head.service->decrease_request(); } else { @@ -150,8 +150,9 @@ void BaiduRpcServer::initialize() { return; } - PADDLE_ENFORCE_NE( - _gloo, NULL, phi::errors::PreconditionNotMet("Gloo not allow nullptr.")); + PADDLE_ENFORCE_NE(_gloo, + nullptr, + phi::errors::PreconditionNotMet("Gloo not allow nullptr.")); _gloo->Barrier(); _server->set_version(google::VersionString()); brpc::ServerOptions option; @@ -237,7 +238,7 @@ static void handle_baidu_rpc_response(brpc::Controller *cntl, delete head.request; PADDLE_ENFORCE_NE( head.service, - 0, + nullptr, phi::errors::PreconditionNotMet("Service should not be nullptr.")); head.service->decrease_request(); } else { diff --git a/python/paddle/fluid/tests/unittests/test_unzip_op.py b/python/paddle/fluid/tests/unittests/test_unzip_op.py index 65a353822b..71caac8c0f 100644 --- a/python/paddle/fluid/tests/unittests/test_unzip_op.py +++ b/python/paddle/fluid/tests/unittests/test_unzip_op.py @@ -31,7 +31,7 @@ class TestUnzipOp(unittest.TestCase): place = fluid.CUDAPlace(0) x = fluid.data(name='X', shape=[3, 4], dtype='float64') lod = fluid.data(name='lod', shape=[11], dtype='int64') - output = paddle.incubate.unzip(x, lod) + output = paddle.incubate.operators.unzip(x, lod) input = [ [1.0, 2.0, 3.0, 4.0], diff --git a/python/paddle/incubate/__init__.py b/python/paddle/incubate/__init__.py index 69d4ca2b0c..97dd8353be 100644 --- a/python/paddle/incubate/__init__.py +++ b/python/paddle/incubate/__init__.py @@ -23,7 +23,6 @@ from .operators import graph_send_recv from .operators import graph_khop_sampler from .operators import graph_sample_neighbors from .operators import graph_reindex -from .operators import unzip from .tensor import segment_sum from .tensor import segment_mean from .tensor import segment_max @@ -56,5 +55,4 @@ __all__ = [ 'segment_max', 'segment_min', 'identity_loss', - 'unzip', ] -- GitLab