Skip to content

Set Input and NIRGraph input_type based on first nodes in graph#38

Closed
fabio-innatera wants to merge 1 commit into
neuromorphs:mainfrom
fabio-innatera:infer-input-types
Closed

Set Input and NIRGraph input_type based on first nodes in graph#38
fabio-innatera wants to merge 1 commit into
neuromorphs:mainfrom
fabio-innatera:infer-input-types

Conversation

@fabio-innatera

@fabio-innatera fabio-innatera commented Jun 9, 2025

Copy link
Copy Markdown
Collaborator

This is based on the discussion in #36.

The code in torch_tracer.py sets the input_type shape of the Input nodes to a dummy value (array[1]), this PR updates this value after the graph has been constructed and we know which nodes follow the input node.

My current idea is that type inference for the Input node happens here in NIRTorch, while the type inference for the Output node happens in NIR itself, in _forward_type_inference.

See neuromorphs/NIR#140 for that change.

Edit: Force push to format code with ruff, updated code comment.

@fabio-innatera fabio-innatera force-pushed the infer-input-types branch 2 times, most recently from 39b6ef9 to 6b79632 Compare June 11, 2025 16:43

@Jegp Jegp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent changes, thank you.

As per our discussion, let's defer this to after the changes in NIR, where the type inference and type checking has been merged into one.

@fabio-innatera

Copy link
Copy Markdown
Collaborator Author

Replaced by #40.

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.

2 participants