Returns the consumers of t, crossing closure boundaries where necessary. Args: t: Tensor func_graphs: a list of FuncGraphs that may have captured t. Returns: A list of tensors. The tensors will be from the current graph and/or func_graphs.
(t, func_graphs)
| 496 | |
| 497 | |
| 498 | def _Consumers(t, func_graphs): |
| 499 | """Returns the consumers of t, crossing closure boundaries where necessary. |
| 500 | |
| 501 | Args: |
| 502 | t: Tensor |
| 503 | func_graphs: a list of FuncGraphs that may have captured t. |
| 504 | |
| 505 | Returns: |
| 506 | A list of tensors. The tensors will be from the current graph and/or |
| 507 | func_graphs. |
| 508 | """ |
| 509 | consumers = t.consumers() |
| 510 | for func in func_graphs: |
| 511 | for input_t, placeholder in _Captures(func): |
| 512 | if input_t is t: |
| 513 | consumers.extend(_Consumers(placeholder, func_graphs)) |
| 514 | return consumers |
| 515 | |
| 516 | |
| 517 | def _GradientsHelper(ys, |
no test coverage detected