Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
817210cf
Unverified
Commit
817210cf
authored
Sep 03, 2018
by
Michał Karzyński
Committed by
GitHub
Sep 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Travis tests bugfix (#1550)
parent
e9443168
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
18 deletions
+35
-18
run_test.sh
.ci/travis/run_test.sh
+26
-5
.travis.yml
.travis.yml
+4
-8
test_onnx_import.py
python/test/ngraph/test_onnx_import.py
+5
-5
No files found.
.ci/travis/run_test.sh
View file @
817210cf
#!/bin/bash
set
-e
echo
"--TRAVIS VARIABLES--"
echo
"TRAVIS_OS_NAME:"
${
TRAVIS_OS_NAME
}
echo
"TRAVIS_BUILD_DIR:"
${
TRAVIS_BUILD_DIR
}
echo
"--CUSTOM VARIABLES--"
echo
"TASK:"
${
TASK
}
echo
"OS:"
${
OS
}
# LINUX TASKS
if
[
${
TRAVIS_OS_NAME
}
==
"linux"
]
;
then
if
[
${
TASK
}
==
"cpp_test"
]
;
then
if
[
${
TASK
}
==
"cpp_test"
]
;
then
docker run
-w
'/root/ngraph/build'
test_ngraph make unit-test-check
fi
fi
if
[
${
TASK
}
==
"python2_test"
]
;
then
if
[
${
TASK
}
==
"python2_test"
]
;
then
docker run
-w
'/root/ngraph/python'
test_ngraph tox
-e
py27
fi
fi
if
[
${
TASK
}
==
"python3_test"
]
;
then
if
[
${
TASK
}
==
"python3_test"
]
;
then
docker run
-w
'/root/ngraph/python'
test_ngraph tox
-e
py3
fi
fi
# MacOS TASKS
if
[
${
TRAVIS_OS_NAME
}
==
"osx"
]
;
then
if
[
${
TASK
}
==
"cpp_test"
]
;
then
cd
${
TRAVIS_BUILD_DIR
}
/build
make unit-test-check
fi
fi
.travis.yml
View file @
817210cf
...
...
@@ -8,10 +8,12 @@ matrix:
-
os
:
linux
sudo
:
required
services
:
docker
language
:
python
env
:
TASK=python2_test OS=ubuntu
-
os
:
linux
sudo
:
required
services
:
docker
language
:
python
env
:
TASK=python3_test OS=ubuntu
-
os
:
linux
sudo
:
required
...
...
@@ -37,17 +39,11 @@ install:
-DNGRAPH_ONNX_IMPORT_ENABLE=TRUE \
-DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
make -j 2
cd -
fi
script
:
-
|
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
.ci/travis/run_test.sh
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
cd $TRAVIS_BUILD_DIR/build
make unit-test-check
fi
-
.ci/travis/run_test.sh
branches
:
only
:
...
...
python/test/ngraph/test_onnx_import.py
View file @
817210cf
...
...
@@ -22,15 +22,15 @@ from test.ngraph.util import get_runtime
def
test_import_onnx_function
():
dtype
=
np
.
float32
cur_dir
=
os
.
path
.
dirname
(
__file__
)
model_path
=
os
.
path
.
join
(
cur_dir
,
'models/add_abc.onnx'
)
model_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'models/add_abc.onnx'
)
ng_function
=
load_onnx_model_file
(
model_path
)[
0
]
dtype
=
np
.
float32
value_a
=
np
.
array
([
1.0
],
dtype
=
dtype
)
value_b
=
np
.
array
([
2.0
],
dtype
=
dtype
)
value_c
=
np
.
array
([
3.0
],
dtype
=
dtype
)
result
=
ng_function
(
value_a
,
value_b
,
value_c
,
runtime
=
get_runtime
())
runtime
=
get_runtime
()
computation
=
runtime
.
computation
(
ng_function
)
result
=
computation
(
value_a
,
value_b
,
value_c
)
assert
np
.
allclose
(
result
,
np
.
array
([
6
],
dtype
=
dtype
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment