Skip to content

Commit 8a2b7fc

Browse files
authored
test: Add test case for output tensor size (#8639)
1 parent 5ae91e8 commit 8a2b7fc

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

qa/L0_parameters/class_count_test.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
# Copyright 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# Copyright 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions
@@ -100,6 +100,19 @@ def test_classificattion_unsupported_data_type(self):
100100
str(e.exception),
101101
)
102102

103+
def test_classification_output_tensor_too_large(self):
104+
max_elements = 1_000_000
105+
shape = (1, max_elements + 1)
106+
dtype = "FP32"
107+
model_name = "identity_fp32"
108+
input_data = np.ones(shape, dtype=np.float32)
109+
110+
inputs, outputs = self._prepare_io(input_data, dtype)
111+
with self.assertRaises(InferenceServerException) as e:
112+
self.client.infer(model_name=model_name, inputs=inputs, outputs=outputs)
113+
114+
self.assertIn("classification output tensor too large", str(e.exception))
115+
103116

104117
if __name__ == "__main__":
105118
unittest.main()

qa/L0_parameters/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2023-2025, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright 2023-2026, NVIDIA CORPORATION. All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions
@@ -136,7 +136,7 @@ for client_type in http grpc; do
136136
echo -e "\n***\n*** Test Failed - class_count_${client_type}_test_client\n***"
137137
RET=1
138138
else
139-
check_test_results $TEST_RESULT_FILE 2
139+
check_test_results $TEST_RESULT_FILE 3
140140
if [ $? -ne 0 ]; then
141141
cat $TEST_RESULT_FILE
142142
echo -e "\n***\n*** Test Result Verification Failed - class_count_${client_type}_test_client\n***"

0 commit comments

Comments
 (0)