For each tensor's pair, replace the end of t1 by the end of t0. B0 B1 B0 B1 | | => |/ A0 A1 A0 A1 The end of the tensors in ts1 are left dangling. Args: ts0: an object convertible to a list of `tf.Tensor`. ts1: an object convertible to a list of `tf.Tenso
(ts0, ts1, can_modify=None, cannot_modify=None)
| 231 | |
| 232 | |
| 233 | def reroute_ts(ts0, ts1, can_modify=None, cannot_modify=None): |
| 234 | """For each tensor's pair, replace the end of t1 by the end of t0. |
| 235 | |
| 236 | B0 B1 B0 B1 |
| 237 | | | => |/ |
| 238 | A0 A1 A0 A1 |
| 239 | |
| 240 | The end of the tensors in ts1 are left dangling. |
| 241 | |
| 242 | Args: |
| 243 | ts0: an object convertible to a list of `tf.Tensor`. |
| 244 | ts1: an object convertible to a list of `tf.Tensor`. |
| 245 | can_modify: iterable of operations which can be modified. Any operation |
| 246 | outside within_ops will be left untouched by this function. |
| 247 | cannot_modify: iterable of operations which cannot be modified. Any |
| 248 | operation within cannot_modify will be left untouched by this function. |
| 249 | Returns: |
| 250 | The number of individual modifications made by the function. |
| 251 | Raises: |
| 252 | TypeError: if ts0 or ts1 cannot be converted to a list of tf.Tensor. |
| 253 | TypeError: if can_modify or cannot_modify is not None and cannot be |
| 254 | converted to a list of tf.Operation. |
| 255 | """ |
| 256 | return _reroute_ts(ts0, ts1, _RerouteMode.a2b, can_modify, cannot_modify) |
| 257 | |
| 258 | |
| 259 | def _reroute_sgv_remap(sgv0, sgv1, mode): |
nothing calls this directly
no test coverage detected