Skip to content

Commit 39c54fd

Browse files
hlu1Wei Chen
authored andcommitted
Add caffe2 nnvm frontend to CI (apache#3018)
1 parent 882cd3f commit 39c54fd

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

nnvm/tests/python/frontend/caffe2/test_forward.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def get_tvm_output(model,
4545
graph, lib, params = nnvm.compiler.build(
4646
sym, target, shape=shape_dict, dtype=dtype_dict, params=params)
4747

48-
ctx = tvm.cpu(0)
4948
m = graph_runtime.create(graph, lib, ctx)
5049

5150
# set inputs
@@ -89,21 +88,21 @@ def verify_caffe2_forward_impl(model, data_shape, out_shape):
8988
tvm.testing.assert_allclose(c2_out, tvm_out, rtol=1e-5, atol=1e-5)
9089

9190

92-
def verify_squeezenet1_1():
91+
def test_squeezenet1_1():
9392
verify_caffe2_forward_impl(c2_squeezenet, (1, 3, 224, 224),
9493
(1, 1000, 1, 1))
9594

9695

97-
def verify_resnet50():
96+
def test_resnet50():
9897
verify_caffe2_forward_impl(c2_resnet50, (1, 3, 224, 224),
9998
(1, 1000))
10099

101100

102-
def verify_vgg19():
101+
def test_vgg19():
103102
verify_caffe2_forward_impl(c2_vgg19, (1, 3, 224, 224), (1, 1000))
104103

105104

106105
if __name__ == '__main__':
107-
verify_squeezenet1_1()
108-
verify_resnet50()
109-
verify_vgg19()
106+
test_squeezenet1_1()
107+
test_resnet50()
108+
test_vgg19()

tests/scripts/task_python_frontend.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# to you under the Apache License, Version 2.0 (the
77
# "License"); you may not use this file except in compliance
88
# with the License. You may obtain a copy of the License at
9-
#
9+
#
1010
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
11+
#
1212
# Unless required by applicable law or agreed to in writing,
1313
# software distributed under the License is distributed on an
1414
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -50,6 +50,9 @@ python3 -m nose -v nnvm/tests/python/frontend/tensorflow
5050
echo "Running nnvm CoreML frontend test..."
5151
python3 -m nose -v nnvm/tests/python/frontend/coreml
5252

53+
echo "Running nnvm Caffe2 frontend test..."
54+
python3 -m nose -v nnvm/tests/python/frontend/caffe2
55+
5356
echo "Running nnvm DarkNet frontend test..."
5457
python3 -m nose -v nnvm/tests/python/frontend/darknet || exit -1
5558

0 commit comments

Comments
 (0)