diff --git a/doc/api/v2/model_configs.rst b/doc/api/v2/model_configs.rst index 26a1669d4363fab6f9acb901a82f523be4456f0e..b848bd7045a701a1a0d6e6b53da971ada2c569f5 100644 --- a/doc/api/v2/model_configs.rst +++ b/doc/api/v2/model_configs.rst @@ -19,3 +19,17 @@ Activations .. automodule:: paddle.v2.activation :members: + +======== +Poolings +======== + +.. automodule:: paddle.v2.pooling + :members: + +======== +Networks +======== + +.. automodule:: paddle.v2.networks + :members: diff --git a/python/paddle/v2/networks.py b/python/paddle/v2/networks.py index 74d91593d8551bc1592a78efb704ab3b89f0e0d9..9e6644196c8242cc3fed7a4fb1503697e5b59ffb 100644 --- a/python/paddle/v2/networks.py +++ b/python/paddle/v2/networks.py @@ -38,6 +38,7 @@ def __initialize__(): parent_names=parents, is_default_name='name' in argspec.args) globals()[each_subnetwork] = v2_subnet + globals()[each_subnetwork].__name__ = each_subnetwork global __all__ __all__.append(each_subnetwork) diff --git a/python/paddle/v2/pooling.py b/python/paddle/v2/pooling.py index 9076a159bb4f2c58bf52cba1657c58510637f4f8..4881c27d1d6d3d926f12aab096f377164debf1ef 100644 --- a/python/paddle/v2/pooling.py +++ b/python/paddle/v2/pooling.py @@ -12,13 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from paddle.trainer_config_helpers.poolings import * +import paddle.trainer_config_helpers.poolings +import copy -__all__ = ["Max", "CudnnMax", "Avg", "CudnnAvg", "Sum", "SquareRootN"] +__all__ = [] +suffix = 'Pooling' -Max = MaxPooling -CudnnMax = CudnnMaxPooling -Avg = AvgPooling -CudnnAvg = CudnnAvgPooling -Sum = SumPooling -SquareRootN = SquareRootNPooling +for name in paddle.trainer_config_helpers.poolings.__all__: + new_name = name[:-len(suffix)] + globals()[new_name] = copy.copy( + getattr(paddle.trainer_config_helpers.poolings, name)) + globals()[new_name].__name__ = new_name + __all__.append(new_name)