Skip to content

Segfault running shape inference with data_prop=True on model with nested function. #5212

@BowenBao

Description

@BowenBao

Bug Report

Is the issue related to model conversion?

No, checker passed. inliner passed.
Same shape inference call passed on inlined model.

Describe the bug

As title

System information

ONNX version: 1.15 dbeee24

Reproduction instructions

Model can be downloaded here.

import onnx
import onnx.shape_inference
import onnx.inliner

model = onnx.load("maf_mnist.onnx")

onnx.checker.check_model(model)
print("Pass checker!")

# Works fine
onnx.shape_inference.infer_shapes(model, data_prop=False)
print("Success with data_prop=False !")

inlined_model = onnx.inliner.inline_local_functions(model)
print("Success with inlining!")
onnx.shape_inference.infer_shapes(inlined_model, data_prop=True)
print("Success with data_prop=True on inlined model !")

# Segfaults
onnx.shape_inference.infer_shapes(model, data_prop=True)

Expected behavior

Notes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions