forked from fossasia/visdom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from 'setattr' to decorator. (fossasia#392)
Summary: First pass at resolving fossasia#389. Closes fossasia#392 Reviewed By: lvdmaaten Differential Revision: D8543559 Pulled By: JackUrb fbshipit-source-id: 6070599d5c9ed85c9ccc2b3dc34d6ca6582f5115
- Loading branch information
1 parent
0eda08f
commit 2305c7c
Showing
2 changed files
with
63 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,24 @@ | |
from pkg_resources import get_distribution, DistributionNotFound | ||
|
||
|
||
try: | ||
import torch | ||
if (torch.__version__ < "0.3.1"): | ||
print( | ||
"[visdom] WARNING: Visdom support for pytorch less than version " | ||
"0.3.1 is unsupported. Visdom will still work for other purposes " | ||
"though." | ||
) | ||
except Exception: | ||
pass # User doesn't have torch | ||
|
||
|
||
def get_dist(pkgname): | ||
try: | ||
return get_distribution(pkgname) | ||
except DistributionNotFound: | ||
return None | ||
|
||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
with open(os.path.join(here, 'py/visdom/VERSION')) as version_file: | ||
|
@@ -34,7 +45,7 @@ def get_dist(pkgname): | |
# Metadata | ||
name='visdom', | ||
version=version, | ||
author='Allan Jabri, Jack Urbanek, Laurens van der Maaten', | ||
author='Jack Urbanek, Allan Jabri, Laurens van der Maaten', | ||
author_email='[email protected]', | ||
url='https://github.com/facebookresearch/visdom', | ||
description='A tool for visualizing live, rich data for Torch and Numpy', | ||
|