def print_tf_op(tf_op, indent="|   ", max_depth=-1, depth=0):
    """ print_tf_op(tf_tensor, indent="    ", max_depth=-1)
    Prints the dependency graph of a tensorflow operation *tf_op*, where each new level is indented
    by *indent*. When *max_depth* is positive, the graph is truncated at that depth, where each
    tensor and each op count as a level.
    """
    offset = depth * indent
    line = "tf op: %s (%s)" % (tf_op.name, tf_op.type)

    print(offset + line)

    if max_depth < 0 or max_depth > depth:
        for tf_tensor in tf_op.inputs:
            print_tf_tensor(tf_tensor, indent=indent, max_depth=max_depth, depth=depth+1)
def print_tf_op ( tf_op , indent = "|   " , max_depth = - 1 , depth = 0 ) : offset = depth * indent line = "tf op: %s (%s)" % ( tf_op . name , tf_op . type ) print ( offset + line ) if max_depth < 0 or max_depth > depth : for tf_tensor in tf_op . inputs : print_tf_tensor ( tf_tensor , indent = indent , max_depth = max_depth , depth = depth + 1 )
print_tf_op(tf_tensor, indent="    ", max_depth=-1)
    Prints the dependency graph of a tensorflow operation *tf_op*, where each new level is indented
    by *indent*. When *max_depth* is positive, the graph is truncated at that depth, where each
    tensor and each op count as a level.