Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onnx-graphsurgeon: fix cycle detection bug in toposort #4087

Open
wants to merge 1 commit into
base: release/10.3
Choose a base branch
from

Conversation

xhdhr10000
Copy link

Fix issue #4086

With this modification. Run toposort on model in #4086 return successfully with:

import onnx
import onnx_graphsurgeon as gs

graph = gs.import_onnx(onnx.load('./toposort.onnx'))
graph.toposort()
""" Out:
Graph onnx_graphsurgeon_graph (Opset 11)
Local Functions: []
Inputs: [Variable (input): (shape=[], dtype=float32)]
Nodes: identity_0 (Identity)
        Inputs: [
                Variable (input): (shape=[], dtype=float32)
        ]
        Outputs: [
                Variable (identity_0_output): (shape=[], dtype=float32)
        ]
neg_1 (Neg)
        Inputs: [
                Variable (identity_0_output): (shape=[], dtype=float32)
        ]
        Outputs: [
                Variable (neg_1_output): (shape=[], dtype=float32)
        ]
mul_0 (Mul)
        Inputs: [
                Variable (identity_0_output): (shape=[], dtype=float32)
                Variable (neg_1_output): (shape=[], dtype=float32)
        ]
        Outputs: [
                Variable (mul_0_output): (shape=[], dtype=float32)
        ]
Outputs: [Variable (mul_0_output): (shape=[], dtype=float32)]
"""

Signed-off-by: xhdhr10000 <xhdhr2007@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant