aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux-cpp-lisp <1473644+Linux-cpp-lisp@users.noreply.github.com>2021-11-17 15:57:44 -0500
committerLinux-cpp-lisp <1473644+Linux-cpp-lisp@users.noreply.github.com>2021-11-17 15:57:44 -0500
commitce73094b493c2fb12e113f1f729f7c876c447715 (patch)
tree2792a0826767fcdc5da3c48162c8379382dd0480
parentf658af9055647685c7713c36de4905f34e4d8508 (diff)
Refactor and bump version
-rw-r--r--CHANGELOG.md4
-rw-r--r--setup.py11
-rw-r--r--torch_ema/__init__.py3
-rw-r--r--torch_ema/_version.py1
4 files changed, 16 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c398f59..03402f6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ Most recent change on the bottom.
## [Unreleased]
+## [0.3.0] - 2021-11-17
+### Added
+- `torch_ema.__version__`
+
### Changed
- Parameters without `requires_grad = True` are no longer partially ignored, resolving #9; now *all* parameters passed to the EMA object have EMA run on them, regardless of whether they are trainable or not.
diff --git a/setup.py b/setup.py
index 550c159..49b8704 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,13 @@
from setuptools import setup, find_packages
+from pathlib import Path
+
+# see https://packaging.python.org/guides/single-sourcing-package-version/
+version_dict = {}
+with open(Path(__file__).parents[0] / "torch_runstats/_version.py") as fp:
+ exec(fp.read(), version_dict)
+version = version_dict["__version__"]
+del version_dict
-__version__ = '0.2'
url = 'https://github.com/fadel/pytorch_ema'
download_url = '{}/archive/{}.tar.gz'.format(url, __version__)
@@ -10,7 +17,7 @@ tests_require = []
setup(
name='torch_ema',
- version=__version__,
+ version=version,
description='PyTorch library for computing moving averages of model parameters.',
author='Samuel G. Fadel',
author_email='samuelfadel@gmail.com',
diff --git a/torch_ema/__init__.py b/torch_ema/__init__.py
index 6cf180f..91c6bbf 100644
--- a/torch_ema/__init__.py
+++ b/torch_ema/__init__.py
@@ -1,3 +1,4 @@
+from ._version import __version__
from .ema import ExponentialMovingAverage
-__all__ = [ExponentialMovingAverage]
+__all__ = [__version__, ExponentialMovingAverage]
diff --git a/torch_ema/_version.py b/torch_ema/_version.py
new file mode 100644
index 0000000..6a35e85
--- /dev/null
+++ b/torch_ema/_version.py
@@ -0,0 +1 @@
+__version__ = "0.3"