From df46716bba906e2d7e4d4fcf3821f9755c20f38b Mon Sep 17 00:00:00 2001 From: Ole Salscheider Date: Sat, 25 May 2024 11:06:03 +0200 Subject: [PATCH] Allow reduction to be set to none for ScatterND The dynamo based ONNX export of pytorch 2 sets this attribute. Signed-off-by: Ole Salscheider --- onnxOpImporters.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxOpImporters.cpp b/onnxOpImporters.cpp index 54f54a0..99975cc 100644 --- a/onnxOpImporters.cpp +++ b/onnxOpImporters.cpp @@ -5112,8 +5112,8 @@ DEFINE_BUILTIN_OP_IMPORTER(GridSample) DEFINE_BUILTIN_OP_IMPORTER(ScatterND) { OnnxAttrs attrs(node, ctx); - ASSERT_NODE(!attrs.count("reduction"), "Attribute reduction is not supported.", node, nodeIdx, - ErrorCode::kUNSUPPORTED_NODE_ATTR); + ASSERT_NODE(!attrs.count("reduction") || attrs.get("reduction") == "none", + "Attribute reduction is not supported.", node, nodeIdx, ErrorCode::kUNSUPPORTED_NODE_ATTR); return addScatterLayer(ctx, node, nodeIdx, inputs, nvinfer1::ScatterMode::kND); }