diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..2ea48a8b28c35f35d3880ccca1d54ea5b3947e0f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.egg-info +build/ +./dist/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8e3fcf66561d1965a047b8debd38a543373f534f --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +#paddlepaddle == 1.6.0rc0 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..ba4187dc687d7c4a236497322b9b1fe77f6d6e6b --- /dev/null +++ b/setup.py @@ -0,0 +1,70 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Setup for pip package.""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import platform + +from setuptools import find_packages +from setuptools import setup +from slim.version import slim_version + + +def python_version(): + return [int(v) for v in platform.python_version().split(".")] + + +max_version, mid_version, min_version = python_version() + +with open('./requirements.txt') as f: + setup_requires = f.read().splitlines() + +packages = [ + 'slim', 'slim.prune', 'slim.dist', 'slim.nas', 'slim.analysis', + 'slim.quant' +] + +setup( + name='slim', + version=slim_version, + description=('A toolkit for generating small model.'), + long_description='', + url='http://gitlab.baidu.com/PaddlePaddle/PaddleSlim', + author='PaddlePaddle Author', + author_email='dltp-all@baidu.com', + install_requires=setup_requires, + packages=packages, + # PyPI package information. + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Topic :: Scientific/Engineering', + 'Topic :: Scientific/Engineering :: Mathematics', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'Topic :: Software Development', + 'Topic :: Software Development :: Libraries', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + license='Apache 2.0', + keywords=('PaddleSlim paddlepaddle model-optimize compression'), ) diff --git a/slim/analysis/__init__.py b/slim/analysis/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0531501ca43921438ee5b2fb58ac0ad2396d1b --- /dev/null +++ b/slim/analysis/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/slim/common/__init__.py b/slim/common/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0531501ca43921438ee5b2fb58ac0ad2396d1b --- /dev/null +++ b/slim/common/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/slim/dist/__init__.py b/slim/dist/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0531501ca43921438ee5b2fb58ac0ad2396d1b --- /dev/null +++ b/slim/dist/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/slim/nas/__init__.py b/slim/nas/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0531501ca43921438ee5b2fb58ac0ad2396d1b --- /dev/null +++ b/slim/nas/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/slim/prune/__init__.py b/slim/prune/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0531501ca43921438ee5b2fb58ac0ad2396d1b --- /dev/null +++ b/slim/prune/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/slim/quant/__init__.py b/slim/quant/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9d0531501ca43921438ee5b2fb58ac0ad2396d1b --- /dev/null +++ b/slim/quant/__init__.py @@ -0,0 +1,13 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/slim/search/__init__.py b/slim/search/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4f3182c3058cb33e46777ab1424242b42406a603 --- /dev/null +++ b/slim/search/__init__.py @@ -0,0 +1,14 @@ +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Controllers and controller server""" diff --git a/slim/version.py b/slim/version.py new file mode 100644 index 0000000000000000000000000000000000000000..f7ed0174edd9207b6d582008761420c12dec8018 --- /dev/null +++ b/slim/version.py @@ -0,0 +1,17 @@ +#coding:utf-8 +# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License" +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" PaddleSlim version string """ +__all__ = ["slim_version"] +slim_version = "4.0"