tf.contrib.graph_editor.reroute_a2b()

tf.contrib.graph_editor.reroute_a2b(sgv0, sgv1) Re-route the inputs and outputs of sgv0 to sgv1 (see _reroute).

tf.contrib.graph_editor.replace_t_with_placeholder_handler()

tf.contrib.graph_editor.replace_t_with_placeholder_handler(info, t) Transform a tensor into a placeholder tensor. This handler is typically used to transform a subgraph input tensor into a placeholder. Args: info: Transform._Info instance. t: tensor whose input must be transformed into a place holder. Returns: The tensor generated by the newly created place holder.

tf.contrib.graph_editor.remove_control_inputs()

tf.contrib.graph_editor.remove_control_inputs(op, cops) Remove the control inputs cops from co. Warning: this function is directly manipulating the internals of the tf.Graph. Args: op: a tf.Operation from which to remove the control inputs. cops: an object convertible to a list of tf.Operation. Raises: TypeError: if op is not a tf.Operation ValueError: if any cop in cops is not a control input of op.

tf.contrib.graph_editor.placeholder_name()

tf.contrib.graph_editor.placeholder_name(t=None, scope=None) Create placeholder name for tjhe graph editor. Args: t: optional tensor on which the placeholder operation's name will be based on scope: absolute scope with which to predix the placeholder's name. None means that the scope of t is preserved. "" means the root scope. Returns: A new placeholder name prefixed by "geph". Note that "geph" stands for Graph Editor PlaceHolder. This convention allows to quickly identify the placeholder

tf.contrib.graph_editor.ph()

tf.contrib.graph_editor.ph(dtype, shape=None, scope=None) Create a tf.placeholder for the Graph Editor. Note that the correct graph scope must be set by the calling function. The placeholder is named using the function placeholder_name (with no tensor argument). Args: dtype: the tensor type. shape: the tensor shape (optional). scope: absolute scope within which to create the placeholder. None means that the scope of t is preserved. "" means the root scope. Returns: A newly created tf.plac

tf.contrib.graph_editor.op_type()

tf.contrib.graph_editor.op_type(op_types, op=None) Check if an op is of the given type. Args: op_types: tuple of strings containing the types to check against. For instance: ("Add", "Const") op: the operation to check (or None). Returns: if op is not None, return True if the op is of the correct type. if op is None, return a lambda function which does the type checking.

tf.contrib.graph_editor.ops()

tf.contrib.graph_editor.ops(*args, **kwargs) Helper to select operations. Args: *args: list of 1) regular expressions (compiled or not) or 2) (array of) tf.Operation. tf.Tensor instances are silently ignored. **kwargs: 'graph': tf.Graph in which to perform the regex query.This is required when using regex. 'positive_filter': an elem if selected only if positive_filter(elem) is True. This is optional. 'restrict_ops_regex': a regular expression is ignored if it doesn't start with the substring

tf.contrib.graph_editor.OpMatcher.__init__()

tf.contrib.graph_editor.OpMatcher.__init__(positive_filter) Graph match constructor.

tf.contrib.graph_editor.OpMatcher.__call__()

tf.contrib.graph_editor.OpMatcher.__call__(op) Evaluate if the op matches or not.

tf.contrib.graph_editor.OpMatcher.output_ops()

tf.contrib.graph_editor.OpMatcher.output_ops(*args) Add output matches.