Skip to content

Commit fd21d0a

Browse files
authored
[NV TRT RTX EP] Add dimension override for TopK model in TestSessionOutputs unittest (#26975)
### Description <!-- Describe your changes. --> - Added dimension override in topk_and_multiple_graph_outputs model to match K value ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> - topk_and_multiple_graph_outputs model in TestSessionOutputs unit test was failing due to shape constraints: TopK: length of reduction axis (N) is smaller than K (300) Condition '==' violated: 0 != 1
1 parent 34bb209 commit fd21d0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

onnxruntime/test/providers/nv_tensorrt_rtx/nv_basic_test.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ TEST(NvExecutionProviderTest, TestSessionOutputs) {
233233
{
234234
Ort::SessionOptions session_options;
235235
session_options.AppendExecutionProvider(kNvTensorRTRTXExecutionProvider, {});
236+
// topk_and_multiple_graph_outputs.onnx contains input with dynamic dimension N
237+
// setting override to avoid shape mismatch
238+
session_options.AddFreeDimensionOverrideByName("N", 300);
236239

237240
auto model_path = ORT_TSTR("testdata/topk_and_multiple_graph_outputs.onnx");
238241
Ort::Session session(*ort_env, model_path, session_options);

0 commit comments

Comments
 (0)