Remap the inputs and outputs of the subgraph. Note that this is only modifying the view: the underlying tf.Graph is not affected. Args: new_input_indices: an iterable of integers or tf.Tensors representing a mapping between the old inputs and the new ones. Integer
(self, new_input_indices=None, new_output_indices=None)
| 407 | return res |
| 408 | |
| 409 | def remap(self, new_input_indices=None, new_output_indices=None): |
| 410 | """Remap the inputs and outputs of the subgraph. |
| 411 | |
| 412 | Note that this is only modifying the view: the underlying tf.Graph is not |
| 413 | affected. |
| 414 | |
| 415 | Args: |
| 416 | new_input_indices: an iterable of integers or tf.Tensors |
| 417 | representing a mapping between the old inputs and the new ones. |
| 418 | Integers must be positive and smaller than the number of old inputs. |
| 419 | tf.Tensors must belong to the old list of inputs. |
| 420 | This mapping can be under-complete and must be without repetitions. |
| 421 | new_output_indices: an iterable of integers or tf.Tensors |
| 422 | representing a mapping between the old outputs and the new ones. |
| 423 | Integers must be positive and smaller than the number of old outputs. |
| 424 | tf.Tensors must belong to the old list of outputs. |
| 425 | This mapping can be under-complete and can have repetitions. |
| 426 | Returns: |
| 427 | A new modified instance of the original subgraph view with remapped |
| 428 | inputs and outputs. |
| 429 | """ |
| 430 | res = copy.copy(self) |
| 431 | if new_input_indices is not None: |
| 432 | res._remap_inputs(new_input_indices) # pylint: disable=protected-access |
| 433 | if new_output_indices is not None: |
| 434 | res._remap_outputs(new_output_indices) # pylint: disable=protected-access |
| 435 | return res |
| 436 | |
| 437 | def find_op_by_name(self, op_name): |
| 438 | """Return the op named op_name. |