Return x as a list of Tensors or IndexedSlices. For entries of `x` that are Operations, this returns an Identity of `p` with a dependency on the operation. Args: x: A Tensor/IndexedSlices/Operation or a list or tuple of them. p: A Tensor to return for entries in `x` that are Operatio
(x, p)
| 2761 | |
| 2762 | |
| 2763 | def _AsTensorList(x, p): |
| 2764 | """Return x as a list of Tensors or IndexedSlices. |
| 2765 | |
| 2766 | For entries of `x` that are Operations, this returns an Identity of `p` |
| 2767 | with a dependency on the operation. |
| 2768 | |
| 2769 | Args: |
| 2770 | x: A Tensor/IndexedSlices/Operation or a list or tuple of them. |
| 2771 | p: A Tensor to return for entries in `x` that are Operations. |
| 2772 | |
| 2773 | Returns: |
| 2774 | A list of Tensors or IndexedSlices. |
| 2775 | """ |
| 2776 | if not isinstance(x, (list, _basetuple)): |
| 2777 | x = [x] |
| 2778 | |
| 2779 | l = [] |
| 2780 | for v in x: |
| 2781 | if isinstance(v, ops.Operation): |
| 2782 | v = with_dependencies([v], p) |
| 2783 | v = ops.convert_to_tensor_or_composite(v) |
| 2784 | if isinstance(v, ops.Tensor): |
| 2785 | l.append(array_ops.identity(v)) |
| 2786 | else: |
| 2787 | l.append( |
| 2788 | ops.IndexedSlices( |
| 2789 | array_ops.identity(v.values), array_ops.identity(v.indices))) |
| 2790 | return l |
| 2791 | |
| 2792 | |
| 2793 | def _CheckResults(a, b): |
nothing calls this directly
no test coverage detected