Commit 60fb9ca
Fix ResourceOpLiftingPass to handle call ops that return tf.ReadVariableOp results.
It is possible for a tf.StatefulPartitionedCall to return the result of a tf.ReadVariableOp (with some potential forwarding through ops like tf.Identity). As return op operands are captured prior to replacing tf.ReadVariableOp results with function args, the new function return operands may not be correct. Instead, when replacing tf.ReadVariableOp results with function args, the operands of the new return are updated.
PiperOrigin-RevId: 320597502
Change-Id: I81f614e0b89670c978da376d5810ff82502f601f1 parent 9065899 commit 60fb9ca
File tree
2 files changed
+44
-7
lines changed- tensorflow/compiler/mlir/tensorflow
- tests
- transforms
2 files changed
+44
-7
lines changedLines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
888 | 888 | | |
| 889 | + | |
| 890 | + | |
889 | 891 | | |
890 | 892 | | |
891 | 893 | | |
892 | 894 | | |
893 | | - | |
| 895 | + | |
894 | 896 | | |
895 | 897 | | |
| 898 | + | |
896 | 899 | | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
897 | 907 | | |
898 | 908 | | |
899 | | - | |
| 909 | + | |
| 910 | + | |
900 | 911 | | |
901 | 912 | | |
902 | 913 | | |
| |||
0 commit comments