提交 e0d5f8a8 编写于 作者: M minqiyang

Move compat module to python/paddle

上级 7e0f66e9
......@@ -205,8 +205,7 @@ void BindBlockDesc(pybind11::module *m) {
void BindVarDsec(pybind11::module *m) {
pybind11::class_<pd::VarDesc> var_desc(*m, "VarDesc", "");
var_desc
.def("name", [](pd::VarDesc &self) { return self.Name(); },
pybind11::return_value_policy::reference)
.def("name", &pd::VarDesc::Name, pybind11::return_value_policy::reference)
.def("set_name", &pd::VarDesc::SetName)
.def("set_shape", &pd::VarDesc::SetShape)
.def("set_shapes", &pd::VarDesc::SetShapes)
......
......@@ -24,4 +24,5 @@ except ImportError:
import paddle.reader
import paddle.dataset
import paddle.batch
import paddle.compat
batch = batch.batch
......@@ -24,7 +24,7 @@ import tarfile
import gzip
import itertools
import paddle.dataset.common
import paddle.fluid.compat as cpt
import paddle.compat as cpt
from six.moves import zip, range
__all__ = ['test, get_dict', 'get_embedding', 'convert']
......
......@@ -28,7 +28,7 @@ import re
import random
import functools
import six
import paddle.fluid.compat as cpt
import paddle.compat as cpt
__all__ = [
'train', 'test', 'get_movie_title_dict', 'max_movie_id', 'max_user_id',
......
......@@ -24,7 +24,7 @@ import tarfile
import gzip
import paddle.dataset.common
import paddle.fluid.compat as cpt
import paddle.compat as cpt
__all__ = [
'train',
......
......@@ -35,7 +35,7 @@ import gzip
from collections import defaultdict
import paddle.dataset.common
import paddle.fluid.compat as cpt
import paddle.compat as cpt
__all__ = [
"train",
......
......@@ -17,7 +17,7 @@ from . import core
import collections
import copy
import six
from . import compat as cpt
from .. import compat as cpt
from . import unique_name
__all__ = ['append_backward']
......
......@@ -19,7 +19,7 @@ import six
import numpy as np
from . import compat as cpt
from .. import compat as cpt
from .proto import framework_pb2
try:
from . import core
......
......@@ -20,7 +20,7 @@ from .layer_function_generator import autodoc, templatedoc
from ..layer_helper import LayerHelper
from . import tensor
from . import nn
from .. import compat as cpt
from ... import compat as cpt
import math
import six
from functools import reduce
......
......@@ -17,7 +17,7 @@ import multiprocessing
from . import core
from . import framework
from . import executor
from . import compat as cpt
from .. import compat as cpt
import warnings
import sys
import six
......
......@@ -13,7 +13,7 @@
# limitations under the License.
import unittest
import paddle.fluid.compat as cpt
import paddle.compat as cpt
import six
......
......@@ -124,7 +124,7 @@ def runtime_main(test_class):
model.run_trainer(p, endpoints, trainer_id, trainers, is_dist)
import paddle.fluid.compat as cpt
import paddle.compat as cpt
class TestDistBase(unittest.TestCase):
......
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import paddle.fluid.compat as cpt
import paddle.compat as cpt
import paddle.fluid.core as core
import unittest
......
......@@ -17,7 +17,7 @@ import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid.compat as cpt
import paddle.compat as cpt
class TestLookupTableOp(OpTest):
......
......@@ -15,7 +15,7 @@
import unittest
import paddle.fluid.core as core
import paddle.fluid.compat as cpt
import paddle.compat as cpt
from paddle.fluid.framework import Program, default_startup_program
......
......@@ -14,7 +14,7 @@
import unittest
import paddle.fluid.core as core
import paddle.fluid.compat as cpt
import paddle.compat as cpt
from paddle.fluid.framework import Program
......
......@@ -16,7 +16,7 @@ import unittest
import numpy as np
import math
import sys
import paddle.fluid.compat as cpt
import paddle.compat as cpt
from op_test import OpTest
......
......@@ -14,7 +14,7 @@
from collections import defaultdict
from .. import core
from .. import compat as cpt
from ... import compat as cpt
from ..framework import Program, default_main_program, Parameter
from ..backward import _rename_arg_
from functools import reduce
......
......@@ -27,7 +27,7 @@ from six.moves import zip
import itertools
import random
import zlib
import paddle.fluid.compat as cpt
import paddle.compat as cpt
def map_readers(func, *readers):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册