diff --git a/python/paddle/framework/io.py b/python/paddle/framework/io.py index f84ed941e35fe6ab302be3b44f632ace01af2584..493574c5bef47a50c633a95488d33fdd7b7dd29d 100644 --- a/python/paddle/framework/io.py +++ b/python/paddle/framework/io.py @@ -496,7 +496,7 @@ def save(obj, path, protocol=2, **configs): Save an object to the specified path. .. note:: - Now supports saving ``state_dict`` of Layer or Optimizer, Tensor. + Now supports saving ``state_dict`` of Layer/Optimizer, Layer, Tensor and nested structure containing Tensor. .. note:: Different from ``paddle.jit.save``, since the save result of ``paddle.save`` is a single file, @@ -560,7 +560,7 @@ def save(obj, path, protocol=2, **configs): prog = paddle.static.default_main_program() for var in prog.list_vars(): if list(var.shape) == [224, 10]: - tensor = var.get_tensor() + tensor = var.get_value() break # save/load tensor @@ -667,7 +667,7 @@ def load(path, **configs): Load an object can be used in paddle from specified path. .. note:: - Now supports load ``state_dict`` of Layer or Optimizer, Tensor. + Now supports loading ``state_dict`` of Layer/Optimizer, Layer, Tensor and nested structure containing Tensor. .. note:: In order to use the model parameters saved by paddle more efficiently, @@ -760,7 +760,7 @@ def load(path, **configs): prog = paddle.static.default_main_program() for var in prog.list_vars(): if list(var.shape) == [224, 10]: - tensor = var.get_tensor() + tensor = var.get_value() break # save/load tensor diff --git a/tools/__pycache__/static_mode_white_list.cpython-37.pyc b/tools/__pycache__/static_mode_white_list.cpython-37.pyc deleted file mode 100644 index b1e58ce7689c7db6cc0ce4ed18f87752b16d8beb..0000000000000000000000000000000000000000 Binary files a/tools/__pycache__/static_mode_white_list.cpython-37.pyc and /dev/null differ