Draft
shape_optimizer: dump GraphDef as .pbtxt before and after optimization pass#6
Conversation
Agent-Logs-Url: https://github.com/fenxcc/tensorflow/sessions/2d470ba1-1472-4dbd-9e4f-82e1c0c0b351 Co-authored-by: fenxcc <64964597+fenxcc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add logging for shape optimizer before and after optimization
shape_optimizer: dump GraphDef as .pbtxt before and after optimization pass
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds debug graph dumping to
ShapeOptimizer::Optimizeso the input and outputGraphDefcan be inspected as.pbtxtfiles around the optimization pass.Changes
shape_optimizer.cc: Includedump_graph.hand add twoDumpGraphDefToFilecalls guarded byVLOG_IS_ON(1):item.graphasbefore_ShapeOptimizer_<item.id>.pbtxt*optimized_graphasafter_ShapeOptimizer_<item.id>.pbtxtUsage
item.idis used as the filename discriminator so before/after pairs are trivially correlated and multiple optimization runs don't collide. Follows the same pattern used inmeta_optimizer.cc.