Merge pull request #39889 from lgeiger:control-deps-generator

PiperOrigin-RevId: 313791292
Change-Id: I20a37f1ff0d9b517a2e6751d88769327f54e79a5
This commit is contained in:
TensorFlower Gardener 2020-05-29 12:22:46 -07:00
commit 6c5999948c
1 changed files with 4 additions and 2 deletions

View File

@ -535,8 +535,10 @@ def _get_resource_inputs(op):
# Note: A resource handle that is not written to is treated as read-only. We
# don't have a special way of denoting an unused resource.
return ([(t, ResourceType.READ_ONLY) for t in reads] +
[(t, ResourceType.READ_WRITE) for t in writes])
for t in reads:
yield (t, ResourceType.READ_ONLY)
for t in writes:
yield (t, ResourceType.READ_WRITE)
def automatic_control_dependencies(f):