tf.contrib.graph_editor.transform_op_if_inside_handler()

tf.contrib.graph_editor.transform_op_if_inside_handler(info, op, keep_if_possible=True) Transform an optional op only if it is inside the subgraph. This handler is typically use to handle original op: it is fine to keep them if they are inside the subgraph, otherwise they are just ignored. Args: info: Transform._Info instance. op: the optional op to transform (or ignore). keep_if_possible: re-attach to the original op if possible, that is, if the source graph and the destination graph are t

tf.contrib.graph_editor.Transformer.__init__()

tf.contrib.graph_editor.Transformer.__init__() Transformer constructor. The following members can be modified: transform_op_handler: handle the transformation of a tf.Operation. This handler defaults to a simple copy. assign_collections_handler: handle the assignment of collections. This handler defaults to assigning new collections created under the given name-scope. transform_external_input_handler: handle the transform of the inputs to the given subgraph. This handler defaults to creating p

tf.contrib.graph_editor.Transformer.__call__()

tf.contrib.graph_editor.Transformer.__call__(sgv, dst_graph, dst_scope, src_scope='', reuse_dst_scope=False) Execute the transformation. Args: sgv: the source subgraph-view. dst_graph: the destination graph. dst_scope: the destination scope. src_scope: the source scope, which specify the path from which the relative path of the transformed nodes are computed. For instance, if src_scope is a/ and dst_scoped is b/, then the node a/x/y will have a relative path of x/y and will be transformed

tf.contrib.graph_editor.Transformer.new_name()

tf.contrib.graph_editor.Transformer.new_name(name) Compute a destination name from a source name. Args: name: the name to be "transformed". Returns: The transformed name. Raises: ValueError: if the source scope is used (that is, not an empty string) and the source name does not belong to the source scope.

tf.contrib.graph_editor.Transformer

class tf.contrib.graph_editor.Transformer Transform a subgraph into another one. By default, the constructor create a transform which copy a subgraph and replaces inputs with placeholders. This behavior can be modified by changing the handlers.

tf.contrib.graph_editor.swap_ts()

tf.contrib.graph_editor.swap_ts(ts0, ts1, can_modify=None, cannot_modify=None) For each tensor's pair, swap the end of (t0,t1). B0 B1 B0 B1 | | => X A0 A1 A0 A1 Args: ts0: an object convertible to a list of tf.Tensor. ts1: an object convertible to a list of tf.Tensor. can_modify: iterable of operations which can be modified. Any operation outside within_ops will be left untouched by this function. cannot_modify: iterable of operations which cannot be modified. Any operation within canno

tf.contrib.graph_editor.swap_outputs()

tf.contrib.graph_editor.swap_outputs(sgv0, sgv1) Swap all the outputs of sgv0 and sgv1 (see _reroute_outputs).

tf.contrib.graph_editor.swap_inputs()

tf.contrib.graph_editor.swap_inputs(sgv0, sgv1) Swap all the inputs of sgv0 and sgv1 (see reroute_inputs).

tf.contrib.graph_editor.swap()

tf.contrib.graph_editor.swap(sgv0, sgv1) Swap the inputs and outputs of sgv1 to sgv0 (see _reroute).

tf.contrib.graph_editor.SubGraphView.__str__()

tf.contrib.graph_editor.SubGraphView.__str__()