Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modelopt/onnx/autocast/precisionconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@ def _cleanup(self):
# Remove redundant casts
self._remove_redundant_casts()

# Update value_info in model's graph
self._update_value_info_in_graph()

def _update_value_info_in_graph(self):
for vi in self.model.graph.value_info:
vi.type.tensor_type.elem_type = self.value_info_map[vi.name].type.tensor_type.elem_type
Comment on lines +961 to +963
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you find the location where we update self.value_info_map instead of self.model.graph.value_info ?
Maybe graph outputs/inputs?

This fix is a little patchy IMO.


def _cleanup_no_consumer_nodes(self):
network_outputs = {o.name for o in self.model.graph.output}
nodes_to_remove = [
Expand Down
Loading