From ec8a283ff90a211947e0616f6d82da1548a8312c Mon Sep 17 00:00:00 2001 From: seiriosPlus Date: Thu, 24 Sep 2020 14:43:01 +0800 Subject: [PATCH] add size method for large scale --- python/paddle/fluid/communicator.py | 3 +++ python/paddle/static/nn/__init__.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/python/paddle/fluid/communicator.py b/python/paddle/fluid/communicator.py index 814a70a10e0..b203e2a80bd 100644 --- a/python/paddle/fluid/communicator.py +++ b/python/paddle/fluid/communicator.py @@ -162,3 +162,6 @@ class LargeScaleKV(object): def load(self, varname, dirname): self.scale_kv.load(varname, dirname) + + def size(self, varname): + return self.scale_kv.size(varname) diff --git a/python/paddle/static/nn/__init__.py b/python/paddle/static/nn/__init__.py index 91da0926b18..0c5d42ad1a1 100644 --- a/python/paddle/static/nn/__init__.py +++ b/python/paddle/static/nn/__init__.py @@ -34,6 +34,7 @@ __all__ = [ 'prelu', 'row_conv', 'spectral_norm', + 'reshape', ] from ...fluid.layers import fc #DEFINE_ALIAS @@ -58,3 +59,4 @@ from ...fluid.layers import row_conv #DEFINE_ALIAS from ...fluid.layers import spectral_norm #DEFINE_ALIAS from ...fluid.input import embedding #DEFINE_ALIAS +from ...fluid.layers import reshape #DEFINE_ALIAS -- GitLab