Skip to content

Commit 2d4e21a

Browse files
committed
Minor improvement
1 parent 956c3d5 commit 2d4e21a

2 files changed

Lines changed: 13 additions & 16 deletions

File tree

qa/L0_shared_memory/shared_memory_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,7 @@ def test_too_big_shm(self):
301301
def test_large_shm_register_offset(self):
302302
# Test for out of bounds read vulnerability when registering system shared memory with large offset
303303
for platform in ["python", "onnx", "libtorch", "plan", "openvino"]:
304-
if platform == "python":
305-
model_name = "simple"
306-
else:
307-
model_name = f"{platform}_int32_int32_int32"
304+
model_name = f"{platform}_int32_int32_int32"
308305

309306
# Test for large offset
310307
error_msg = []

qa/L0_shared_memory/test.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,22 @@ done
158158

159159
# Test large system shared memory offset
160160
rm -rf models/*
161-
162-
# Prepare add_sub model of various backends
161+
# prepare add_sub model of various backends
163162
BACKENDS="python onnx libtorch plan openvino"
164163
for backend in ${BACKENDS} ; do
164+
model="${backend}_int32_int32_int32"
165+
model_dir="models/${model}"
165166
if [[ $backend == "python" ]]; then
166-
mkdir -p models/simple/1
167-
cp ../python_models/add_sub/model.py ./models/simple/1/
168-
cp ../python_models/add_sub/config.pbtxt ./models/simple/
169-
sed -i 's/TYPE_FP32/TYPE_INT32/g' ./models/simple/config.pbtxt
170-
echo "max_batch_size: 8" >> ./models/simple/config.pbtxt
167+
mkdir -p ${model_dir}/1
168+
cp ../python_models/add_sub/model.py ${model_dir}/1/
169+
cp ../python_models/add_sub/config.pbtxt ${model_dir}/
170+
sed -i 's/TYPE_FP32/TYPE_INT32/g' ${model_dir}/config.pbtxt
171+
echo "max_batch_size: 8" >> ${model_dir}/config.pbtxt
171172
else
172-
model="${backend}_int32_int32_int32"
173-
mkdir -p models/${model}
174-
cp -r $DATADIR/qa_model_repository/${model}/1 models/${model}/1
175-
cp $DATADIR/qa_model_repository/${model}/config.pbtxt models/${model}/
176-
cp $DATADIR/qa_model_repository/${model}/output0_labels.txt models/${model}/
173+
mkdir -p ${model_dir}
174+
cp -r $DATADIR/qa_model_repository/${model}/1 ${model_dir}/1
175+
cp $DATADIR/qa_model_repository/${model}/config.pbtxt ${model_dir}/
176+
cp $DATADIR/qa_model_repository/${model}/output0_labels.txt ${model_dir}/
177177
if [ $backend == "openvino" ]; then
178178
echo 'parameters { key: "ENABLE_BATCH_PADDING" value { string_value: "YES" } }' >> models/${model}/config.pbtxt
179179
fi

0 commit comments

Comments
 (0)