forked from Samsung/ONE
-
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.
[one-cmds] Add more tests for one-import-onnx-ext (Samsung#13936)
This will add more tests for one-import-onnx-ext. - new material download is also added in prepare_test_materials.sh ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
- Loading branch information
1 parent
4e04e6a
commit b097991
Showing
5 changed files
with
228 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# test for one-import-onnx to invoke extension | ||
# force to use extension | ||
|
||
filename_ext="$(basename -- $0)" | ||
filename="${filename_ext%.*}" | ||
|
||
trap_err_onexit() | ||
{ | ||
echo "${filename_ext} FAILED" | ||
rm -f ../bin/one-import-onnx-ext | ||
exit 255 | ||
} | ||
|
||
trap trap_err_onexit ERR | ||
|
||
inputfile="./onnx_conv2d_conv2d.onnx" | ||
outputfile="./onnx_conv2d_conv2d.onnx_ext_002.circle" | ||
logfile=${filename}.log | ||
|
||
rm -f ${outputfile} | ||
rm -f ${logfile} | ||
|
||
# copy dummy-compile to bin folder | ||
cp dummy-onnx-ext ../bin/one-import-onnx-ext | ||
|
||
# run test | ||
one-import-onnx \ | ||
--force_ext \ | ||
--input_path ${inputfile} \ | ||
--output_path ${outputfile} > ${logfile} 2>&1 | ||
|
||
if ! grep -q "one-import-onnx-ext dummy output!!!" "${logfile}"; then | ||
trap_err_onexit | ||
fi | ||
|
||
rm -f ../bin/one-import-onnx-ext | ||
|
||
echo "${filename_ext} SUCCESS" | ||
exit 0 |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# test for one-import-onnx to invoke extension | ||
# test for model that onnx-tf fails and should run extension | ||
|
||
filename_ext="$(basename -- $0)" | ||
filename="${filename_ext%.*}" | ||
|
||
trap_err_onexit() | ||
{ | ||
echo "${filename_ext} FAILED" | ||
rm -f ../bin/one-import-onnx-ext | ||
exit 255 | ||
} | ||
|
||
trap trap_err_onexit ERR | ||
|
||
inputfile="./onnx_tf_error_model.onnx" | ||
outputfile="./onnx_tf_error_model.onnx.onnx_ext_003.circle" | ||
logfile=${filename}.log | ||
|
||
rm -f ${outputfile} | ||
rm -f ${logfile} | ||
|
||
# copy dummy-compile to bin folder | ||
cp dummy-onnx-ext ../bin/one-import-onnx-ext | ||
|
||
# input file should exist | ||
if [[ ! -f ${inputfile} ]]; then | ||
trap_err_onexit | ||
fi | ||
|
||
# run test | ||
one-import-onnx \ | ||
--input_path ${inputfile} \ | ||
--output_path ${outputfile} > ${logfile} 2>&1 | ||
|
||
# onnx-tf should fail and the extension should run | ||
if ! grep -q "one-import-onnx-ext dummy output!!!" "${logfile}"; then | ||
trap_err_onexit | ||
fi | ||
|
||
rm -f ../bin/one-import-onnx-ext | ||
|
||
echo "${filename_ext} SUCCESS" | ||
exit 0 |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# test for one-import-onnx to invoke extension | ||
# force_ext is given but onne-import-onnx-ext is not installed | ||
|
||
filename_ext="$(basename -- $0)" | ||
filename="${filename_ext%.*}" | ||
|
||
trap_err_onexit() | ||
{ | ||
echo "${filename_ext} FAILED" | ||
exit 255 | ||
} | ||
|
||
trap trap_err_onexit ERR | ||
|
||
inputfile="./onnx_conv2d_conv2d.onnx" | ||
outputfile="./onnx_conv2d_conv2d.onnx_ext_004.circle" | ||
logfile=${filename}.log | ||
|
||
rm -f ${outputfile} | ||
rm -f ${logfile} | ||
|
||
# be sure to remove one-import-onnx-ext | ||
rm -f ../bin/one-import-onnx-ext | ||
|
||
# run test | ||
one-import-onnx \ | ||
--force_ext \ | ||
--input_path ${inputfile} \ | ||
--output_path ${outputfile} > ${logfile} 2>&1 | ||
|
||
# one-import-onnx should execute without error | ||
|
||
echo "${filename_ext} SUCCESS" | ||
exit 0 |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# test for one-import-onnx to invoke extension | ||
# error for both force_ext and disable_ext given | ||
|
||
filename_ext="$(basename -- $0)" | ||
filename="${filename_ext%.*}" | ||
|
||
trap_err_onexit() | ||
{ | ||
rm -f ../bin/one-import-onnx-ext | ||
if grep -q "one-import-onnx: error" "${logfile}"; then | ||
echo "${filename_ext} SUCCESS" | ||
exit 0 | ||
fi | ||
exit 255 | ||
} | ||
|
||
trap trap_err_onexit ERR | ||
|
||
inputfile="./onnx_conv2d_conv2d.onnx" | ||
outputfile="./onnx_conv2d_conv2d.onnx_ext_neg_001.circle" | ||
logfile=${filename}.log | ||
|
||
rm -f ${outputfile} | ||
rm -f ${logfile} | ||
|
||
# copy dummy-compile to bin folder | ||
cp dummy-onnx-ext ../bin/one-import-onnx-ext | ||
|
||
# run test | ||
one-import-onnx \ | ||
--force_ext \ | ||
--disable_ext \ | ||
--input_path ${inputfile} \ | ||
--output_path ${outputfile} > ${logfile} 2>&1 | ||
|
||
rm -f ../bin/one-import-onnx-ext | ||
|
||
echo "${filename_ext} FAILED" | ||
exit 255 |
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