hamzaqureshi5 opened a new pull request, #19967: URL: https://github.com/apache/tvm/pull/19967
The ONNX importer's Gather converter asserted that indices must be a constant whenever the data operand is a ShapeExpr, raising "Only constant indices supported for shape gather." for any runtime-computed index. Detection post-processing graphs such as FasterRCNN feed a dynamic index into a Gather whose data comes from a Shape node, so import failed before compilation could start. Keep the constant-index fast path, which resolves a single dimension to a PrimValue and preserves shape-specialized handling downstream. For a dynamic index, materialize the shape as an int64 tensor via shape_to_tensor and gather from it at runtime, mirroring how Reshape already handles ShapeExpr inputs. Adds a regression test that gathers a dimension out of a Shape result using a non-constant index and checks it against onnxruntime. Fixes part of #19965. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
