If t is a captured value placeholder, returns the original captured value. Args: t: Tensor Returns: A tensor, potentially from a different Graph/FuncGraph.
(t)
| 431 | |
| 432 | |
| 433 | def _MaybeCaptured(t): |
| 434 | """If t is a captured value placeholder, returns the original captured value. |
| 435 | |
| 436 | Args: |
| 437 | t: Tensor |
| 438 | |
| 439 | Returns: |
| 440 | A tensor, potentially from a different Graph/FuncGraph. |
| 441 | """ |
| 442 | # pylint: disable=protected-access |
| 443 | if (not isinstance(t, ops.EagerTensor) and |
| 444 | _IsFunction(t.op.graph) and t.op.type == "Placeholder"): |
| 445 | for input_t, placeholder_t in _Captures(t.op.graph): |
| 446 | if t is placeholder_t: |
| 447 | return _MaybeCaptured(input_t) |
| 448 | # pylint: enable=protected-access |
| 449 | return t |
| 450 | |
| 451 | |
| 452 | def _NonEagerInputs(op, xs_set): |
no test coverage detected