Skip to content

Commit 4087bc7

Browse files
committed
add travis
1 parent 26f0d3b commit 4087bc7

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: python
2+
python:
3+
- "3.6"
4+
- "3.7"
5+
# command to install dependencies
6+
install:
7+
- pip3 install torch==1.3.0+cpu torchvision==0.4.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
8+
- pip install -r requirements.txt
9+
script:
10+
- pytest

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
numpy os io subprocess sys

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
env PYTHONPATH=$(pwd):${PYTHONPATH} pytest -vv -l --disable-pytest-warnings
1+
pytest -vv -l --disable-pytest-warnings

tests/test_cmpo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import torch
22
import numpy as np
3+
import sys, os
4+
testdir = os.path.dirname(os.path.abspath(__file__))
5+
sys.path.append(testdir+"/..")
36
from cmpo import *
47

58
def test_project():

tests/test_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import torch
22
import numpy as np
3+
import functools
4+
import sys, os
5+
testdir = os.path.dirname(os.path.abspath(__file__))
6+
sys.path.append(testdir+"/..")
37
from cmpo import *
48
from model import *
5-
import functools
9+
610
tnp = lambda a, b, c: torch.einsum('ab,cd,ef->acebdf', a, b, c).view(a.shape[0]*b.shape[0]*c.shape[0], a.shape[1]*b.shape[1]*c.shape[1])
711

812
def decorator_test_model(func):

0 commit comments

Comments
 (0)