Identity op that recognizes `TensorArray`, `Operation`, and `Tensor`.
(x)
| 52 | |
| 53 | |
| 54 | def _identity(x): |
| 55 | """Identity op that recognizes `TensorArray`, `Operation`, and `Tensor`.""" |
| 56 | if isinstance(x, tensor_array_ops.TensorArray): |
| 57 | return x.identity() |
| 58 | elif isinstance(x, ops.Operation): |
| 59 | return control_flow_ops.group(x) |
| 60 | elif context.executing_eagerly() and x is None: |
| 61 | return None |
| 62 | else: |
| 63 | return array_ops.identity(x) |
| 64 | |
| 65 | |
| 66 | def _get_colocation(op): |
no test coverage detected