tf.contrib.graph_editor.make_placeholder_from_tensor()

tf.contrib.graph_editor.make_placeholder_from_tensor(t, scope=None) Create a tf.placeholder for the Graph Editor. Note that the correct graph scope must be set by the calling function. Args: t: a tf.Tensor whose name will be used to create the placeholder (see function placeholder_name). 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.placeholder. Raises: TypeError: if t is not

tf.contrib.graph_editor.make_view_from_scope()

tf.contrib.graph_editor.make_view_from_scope(scope, graph) Make a subgraph from a name scope. Args: scope: the name of the scope. graph: the tf.Graph. Returns: A subgraph view representing the given scope.

tf.contrib.graph_editor.make_placeholder_from_dtype_and_shape()

tf.contrib.graph_editor.make_placeholder_from_dtype_and_shape(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.

tf.contrib.graph_editor.make_list_of_t()

tf.contrib.graph_editor.make_list_of_t(ts, check_graph=True, allow_graph=True, ignore_ops=False) Convert ts to a list of tf.Tensor. Args: ts: can be an iterable of tf.Tensor, a tf.Graph or a single tensor. check_graph: if True check if all the tensors belong to the same graph. allow_graph: if False a tf.Graph cannot be converted. ignore_ops: if True, silently ignore tf.Operation. Returns: A newly created list of tf.Tensor. Raises: TypeError: if ts cannot be converted to a list of tf.Ten

tf.contrib.graph_editor.make_list_of_op()

tf.contrib.graph_editor.make_list_of_op(ops, check_graph=True, allow_graph=True, ignore_ts=False) Convert ops to a list of tf.Operation. Args: ops: can be an iterable of tf.Operation, a tf.Graph or a single operation. check_graph: if True check if all the operations belong to the same graph. allow_graph: if False a tf.Graph cannot be converted. ignore_ts: if True, silently ignore tf.Tensor. Returns: A newly created list of tf.Operation. Raises: TypeError: if ops cannot be converted to a

tf.contrib.graph_editor.keep_t_if_possible_handler()

tf.contrib.graph_editor.keep_t_if_possible_handler(info, t) Transform a tensor into itself (identity) if possible. This handler transform a tensor into itself if the source and destination graph are the same. Otherwise it will create a placeholder. This handler is typically used to transform a hidden input tensors. 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.get_within_boundary_ops()

tf.contrib.graph_editor.get_within_boundary_ops(ops, seed_ops, boundary_ops=(), inclusive=True, control_inputs=False, control_outputs=None, control_ios=None) Return all the tf.Operation within the given boundary. Args: ops: an object convertible to a list of tf.Operation. those ops define the set in which to perform the operation (if a tf.Graph is given, it will be converted to the list of all its operations). seed_ops: the operations from which to start expanding. boundary_ops: the ops for

tf.contrib.graph_editor.get_walks_union_ops()

tf.contrib.graph_editor.get_walks_union_ops(forward_seed_ops, backward_seed_ops, forward_inclusive=True, backward_inclusive=True, within_ops=None, control_inputs=False, control_outputs=None, control_ios=None) Return the union of a foward and a backward walk. Args: forward_seed_ops: an iterable of operations from which the forward graph walk starts. If a list of tensors is given instead, the seed_ops are set to be the consumers of those tensors. backward_seed_ops: an iterable of operations fr

tf.contrib.graph_editor.graph_replace()

tf.contrib.graph_editor.graph_replace(target_ts, replacement_ts, dst_scope='', src_scope='', reuse_dst_scope=False) Create a new graph which compute the targets from the replaced Tensors. Args: target_ts: a single tf.Tensor or an iterabble of tf.Tensor. replacement_ts: dictionary mapping from original tensors to replaced tensors dst_scope: the destination scope. src_scope: the source scope. reuse_dst_scope: if True the dst_scope is re-used if it already exists. Otherwise, the scope is giv

tf.contrib.graph_editor.get_walks_intersection_ops()

tf.contrib.graph_editor.get_walks_intersection_ops(forward_seed_ops, backward_seed_ops, forward_inclusive=True, backward_inclusive=True, within_ops=None, control_inputs=False, control_outputs=None, control_ios=None) Return the intersection of a foward and a backward walk. Args: forward_seed_ops: an iterable of operations from which the forward graph walk starts. If a list of tensors is given instead, the seed_ops are set to be the consumers of those tensors. backward_seed_ops: an iterable of