Skip to content

Add NodeEquivalenceMapper - #4832

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_968770823
Aug 25, 2026
Merged

Add NodeEquivalenceMapper#4832
copybara-service[bot] merged 1 commit into
mainfrom
test_968770823

Conversation

@copybara-service

Copy link
Copy Markdown

Add NodeEquivalenceMapper

Introduces an EquivalenceMapping abstract class that determines given some original Node and some variant Node whether it knows how to transform some of the original's inputs or the output of original such that the variant node type could be used in its place. For example, negating the second operand of a subtract allows using an add instead.

This class will enable resource sharing to not concern itself with how a source Node or destination Node in a folding have to be modified in order to be folded, whether intermediate operations on input operands or on the output are required.

@copybara-service
copybara-service Bot force-pushed the test_968770823 branch 2 times, most recently from a4f4764 to 70a6ad2 Compare August 25, 2026 21:24
Introduces an EquivalenceMapping abstract class that determines given some `original` Node and some `variant` Node whether it knows how to transform some of the `original`'s inputs or the output of `original` such that the `variant` node type could be used in its place. For example, negating the second operand of a subtract allows using an add instead.

This class will enable resource sharing to not concern itself with how a source Node or destination Node in a folding have to be modified in order to be folded, whether intermediate operations on input operands or on the output are required.

PiperOrigin-RevId: 970816219
@copybara-service
copybara-service Bot merged commit dab9a7a into main Aug 25, 2026
4 checks passed
@copybara-service
copybara-service Bot deleted the test_968770823 branch August 25, 2026 22:06
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