3 # Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 filename_ext="$(basename -- $0)"
18 filename="${filename_ext%.*}"
20 # TODO Resolve circledump not found
21 # https://github.com/Samsung/ONE/issues/10550
22 if ! command -v circledump &> /dev/null
24 echo "${filename_ext} SKIPPED"
30 echo "${filename_ext} FAILED"
34 trap trap_err_onexit ERR
36 inputfile="./reshape_matmul.circle"
37 outputfile="./reshape_matmul.one-quantize_016.circle"
40 rm -f ${filename}.first.cdump
41 rm -f ${filename}.second.cdump
44 # run test with different input_type
46 --input_dtype float32 \
47 --quantized_dtype uint8 \
48 --granularity channel \
49 --input_type uint8,int16 \
50 --input_path ${inputfile} \
51 --output_path ${outputfile} > ${filename}.log 2>&1
53 if [[ ! -s "${outputfile}" ]]; then
57 circledump ${outputfile} | grep serving_default_l.1:0$ > ${filename}.first.cdump
58 circledump ${outputfile} | grep serving_default_r.1:0$ > ${filename}.second.cdump
60 # check dtype of the first input (uint8)
61 if ! grep -q "UINT8" "${filename}.first.cdump"; then
65 # check dtype of the second input (int16)
66 if ! grep -q "INT16" "${filename}.second.cdump"; then
70 echo "${filename_ext} SUCCESS"