From 567e514bf08875fa9f7ce7caf41968b46d2ca655 Mon Sep 17 00:00:00 2001 From: Francesco Conti Date: Thu, 9 Apr 2020 12:58:19 +0200 Subject: [PATCH] Reorganized nemo as a PyPI package (#3) * Reorganized nemo as a PIP package * Added install_requires requirements to setup.py --- .github/workflows/nemo.yml | 2 +- __init__.py => nemo/__init__.py | 0 evaluation.py => nemo/evaluation.py | 0 graph.py => nemo/graph.py | 0 precision.py => nemo/precision.py | 0 {quant => nemo/quant}/__init__.py | 0 {quant => nemo/quant}/pact.py | 0 relaxation.py => nemo/relaxation.py | 0 {transf => nemo/transf}/__init__.py | 0 {transf => nemo/transf}/bias.py | 0 {transf => nemo/transf}/bn.py | 0 {transf => nemo/transf}/common.py | 0 {transf => nemo/transf}/deploy.py | 0 {transf => nemo/transf}/equalize.py | 0 {transf => nemo/transf}/export.py | 0 {transf => nemo/transf}/pruning.py | 0 {transf => nemo/transf}/statistics.py | 0 {transf => nemo/transf}/utils.py | 0 transform.py => nemo/transform.py | 0 utils.py => nemo/utils.py | 0 setup.py | 29 +++++++++++++++++++++++++++ 21 files changed, 30 insertions(+), 1 deletion(-) rename __init__.py => nemo/__init__.py (100%) rename evaluation.py => nemo/evaluation.py (100%) rename graph.py => nemo/graph.py (100%) rename precision.py => nemo/precision.py (100%) rename {quant => nemo/quant}/__init__.py (100%) rename {quant => nemo/quant}/pact.py (100%) rename relaxation.py => nemo/relaxation.py (100%) rename {transf => nemo/transf}/__init__.py (100%) rename {transf => nemo/transf}/bias.py (100%) rename {transf => nemo/transf}/bn.py (100%) rename {transf => nemo/transf}/common.py (100%) rename {transf => nemo/transf}/deploy.py (100%) rename {transf => nemo/transf}/equalize.py (100%) rename {transf => nemo/transf}/export.py (100%) rename {transf => nemo/transf}/pruning.py (100%) rename {transf => nemo/transf}/statistics.py (100%) rename {transf => nemo/transf}/utils.py (100%) rename transform.py => nemo/transform.py (100%) rename utils.py => nemo/utils.py (100%) create mode 100644 setup.py diff --git a/.github/workflows/nemo.yml b/.github/workflows/nemo.yml index 8790066..455727d 100644 --- a/.github/workflows/nemo.yml +++ b/.github/workflows/nemo.yml @@ -38,4 +38,4 @@ jobs: - name: Test run: | # pip install pytest - cd tests; wget https://raw.githubusercontent.com/FrancescoConti/nemo_examples_helper/master/mnist_cnn_fp.pt; PYTHONPATH=`pwd`/../.. python mnist_test.py + cd tests; wget https://raw.githubusercontent.com/FrancescoConti/nemo_examples_helper/master/mnist_cnn_fp.pt; PYTHONPATH=`pwd`/.. python mnist_test.py diff --git a/__init__.py b/nemo/__init__.py similarity index 100% rename from __init__.py rename to nemo/__init__.py diff --git a/evaluation.py b/nemo/evaluation.py similarity index 100% rename from evaluation.py rename to nemo/evaluation.py diff --git a/graph.py b/nemo/graph.py similarity index 100% rename from graph.py rename to nemo/graph.py diff --git a/precision.py b/nemo/precision.py similarity index 100% rename from precision.py rename to nemo/precision.py diff --git a/quant/__init__.py b/nemo/quant/__init__.py similarity index 100% rename from quant/__init__.py rename to nemo/quant/__init__.py diff --git a/quant/pact.py b/nemo/quant/pact.py similarity index 100% rename from quant/pact.py rename to nemo/quant/pact.py diff --git a/relaxation.py b/nemo/relaxation.py similarity index 100% rename from relaxation.py rename to nemo/relaxation.py diff --git a/transf/__init__.py b/nemo/transf/__init__.py similarity index 100% rename from transf/__init__.py rename to nemo/transf/__init__.py diff --git a/transf/bias.py b/nemo/transf/bias.py similarity index 100% rename from transf/bias.py rename to nemo/transf/bias.py diff --git a/transf/bn.py b/nemo/transf/bn.py similarity index 100% rename from transf/bn.py rename to nemo/transf/bn.py diff --git a/transf/common.py b/nemo/transf/common.py similarity index 100% rename from transf/common.py rename to nemo/transf/common.py diff --git a/transf/deploy.py b/nemo/transf/deploy.py similarity index 100% rename from transf/deploy.py rename to nemo/transf/deploy.py diff --git a/transf/equalize.py b/nemo/transf/equalize.py similarity index 100% rename from transf/equalize.py rename to nemo/transf/equalize.py diff --git a/transf/export.py b/nemo/transf/export.py similarity index 100% rename from transf/export.py rename to nemo/transf/export.py diff --git a/transf/pruning.py b/nemo/transf/pruning.py similarity index 100% rename from transf/pruning.py rename to nemo/transf/pruning.py diff --git a/transf/statistics.py b/nemo/transf/statistics.py similarity index 100% rename from transf/statistics.py rename to nemo/transf/statistics.py diff --git a/transf/utils.py b/nemo/transf/utils.py similarity index 100% rename from transf/utils.py rename to nemo/transf/utils.py diff --git a/transform.py b/nemo/transform.py similarity index 100% rename from transform.py rename to nemo/transform.py diff --git a/utils.py b/nemo/utils.py similarity index 100% rename from utils.py rename to nemo/utils.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..791099f --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +import setuptools + +with open("README.md", "r") as fh: + long_description = fh.read() + +setuptools.setup( + name="NEMO", + version="0.1", + author="Francesco Conti", + author_email="f.conti@unibo.it", + description="NEural Minimizer for pytOrch", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/pulp-platform/nemo", + packages=setuptools.find_packages(), + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + ], + python_requires='>=3.5', + install_requires=[ + "torch>=1.3.0", + "torchvision>=0.4.1", + "numpy", + "tqdm", + "packaging" + ] +)