Skip to content

Commit

Permalink
Merge pull request #4 from haowen-xu/examples
Browse files Browse the repository at this point in the history
Examples
  • Loading branch information
haowen-xu committed Feb 20, 2020
2 parents 22708ed + 1b80425 commit 3945c5a
Show file tree
Hide file tree
Showing 122 changed files with 4,763 additions and 1,451 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ignore_errors = True
omit =
tests/*
scripts/*
tensorkit/examples/*
tensorkit/backend/pytorch_/_make_dtypes_mapper.py
setup.py
*.pyt
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ install:
- pip install --upgrade coverage coveralls
- pip install -r requirements-dev.txt
script:
# run tests with PyTorch
# run tests with PyTorch 1.3.1
- pip install torch==1.3.1
- TENSORKIT_BACKEND=PyTorch TENSORKIT_DISABLE_JIT=true coverage run -a -m pytest
- TENSORKIT_BACKEND=PyTorch TENSORKIT_DISABLE_JIT=false coverage run -a -m pytest
# # run tests with PyTorch 1.4.0
# - pip install torch==1.4.0
# - TENSORKIT_BACKEND=PyTorch TENSORKIT_DISABLE_JIT=true coverage run -a -m pytest
# - TENSORKIT_BACKEND=PyTorch TENSORKIT_DISABLE_JIT=false coverage run -a -m pytest
after_success:
- coveralls
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## TensorKit

### Requirements

* PyTorch: 1.3.1

3 changes: 2 additions & 1 deletion tensorkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
__version__ = '0.0.1'


from . import backend, distributions, flows, init, layers, losses, variational
from . import (backend, distributions, flows, init, layers, optim, train,
utils, variational)
from .bayes import *
# from .distributions import *
# from .layers import *
Expand Down
2 changes: 1 addition & 1 deletion tensorkit/arg_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def validate_positive_int(arg_name: str, arg_value) -> int:

# layer argument validators
def validate_layer(arg_name: str, layer) -> 'Module':
from tensorkit.tensor import is_jit_layer
from tensorkit.layers import is_jit_layer
if isinstance(layer, Module) or is_jit_layer(layer):
return layer
else:
Expand Down
6 changes: 3 additions & 3 deletions tensorkit/backend/losses.py → tensorkit/backend/optim.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from ..settings_ import settings

if settings.backend == 'PyTorch':
from .pytorch_ import losses
from .pytorch_.losses import *
from .pytorch_ import optim
from .pytorch_.optim import *
else:
RuntimeError(f'Backend {settings.backend} not supported.')

__all__ = losses.__all__
__all__ = optim.__all__
Loading

0 comments on commit 3945c5a

Please sign in to comment.