tf.contrib.graph_editor.assign_renamed_collections_handler()

tf.contrib.graph_editor.assign_renamed_collections_handler(info, elem, elem_) Add the transformed elem to the (renamed) collections of elem. Args: info: Transform._Info instance. elem: the original element (tf.Tensor or tf.Operation) elem_: the transformed element

tf.contrib.framework.VariableDeviceChooser

class tf.contrib.framework.VariableDeviceChooser Device chooser for variables. When using a parameter server it will assign them in a round-robin fashion. When not using a parameter server it allows GPU or CPU placement.

tf.contrib.framework.with_shape()

tf.contrib.framework.with_shape(expected_shape, tensor) Asserts tensor has expected shape. If tensor shape and expected_shape, are fully defined, assert they match. Otherwise, add assert op that will validate the shape when tensor is evaluated, and set shape on tensor. Args: expected_shape: Expected shape to assert, as a 1D array of ints, or tensor of same. tensor: Tensor whose shape we're validating. Returns: tensor, perhaps with a dependent assert operation. Raises: ValueError: if tenso

tf.contrib.framework.VariableDeviceChooser.__init__()

tf.contrib.framework.VariableDeviceChooser.__init__(num_tasks=0, job_name='ps', device_type='CPU', device_index=0) Initialize VariableDeviceChooser. Usage: To use with 2 parameter servers: VariableDeviceChooser(2) To use without parameter servers: VariableDeviceChooser() VariableDeviceChooser(device_type='GPU') # For GPU placement Args: num_tasks: number of tasks. job_name: String, a name for the parameter server job. device_type: Optional device type string (e.g. "CPU" or "GPU") device_in

tf.contrib.framework.VariableDeviceChooser.__call__()

tf.contrib.framework.VariableDeviceChooser.__call__(op)

tf.contrib.framework.with_same_shape()

tf.contrib.framework.with_same_shape(expected_tensor, tensor) Assert tensors are the same shape, from the same graph. Args: expected_tensor: Tensor with expected shape. tensor: Tensor of actual values. Returns: Tuple of (actual_tensor, label_tensor), possibly with assert ops added.

tf.contrib.framework.variable()

tf.contrib.framework.variable(*args, **kwargs) Gets an existing variable with these parameters or creates a new one. Args: name: the name of the new or existing variable. shape: shape of the new or existing variable. dtype: type of the new or existing variable (defaults to DT_FLOAT). initializer: initializer for the variable if one is created. regularizer: a (Tensor -> Tensor or None) function; the result of applying it on a newly created variable will be added to the collection GraphK

tf.contrib.framework.is_tensor()

tf.contrib.framework.is_tensor(x) Check for tensor types. Check whether an object is a tensor. Equivalent to isinstance(x, [tf.Tensor, tf.SparseTensor, tf.Variable]). Args: x: An python object to check. Returns: True if x is a tensor, False if not.

tf.contrib.framework.local_variable()

tf.contrib.framework.local_variable(initial_value, validate_shape=True, name=None) Create variable and add it to GraphKeys.LOCAL_VARIABLES collection. Args: initial_value: See variables.Variable.__init__. validate_shape: See variables.Variable.__init__. name: See variables.Variable.__init__. Returns: New variable.

tf.contrib.framework.reduce_sum_n()

tf.contrib.framework.reduce_sum_n(tensors, name=None) Reduce tensors to a scalar sum. This reduces each tensor in tensors to a scalar via tf.reduce_sum, then adds them via tf.add_n. Args: tensors: List of tensors, all of the same numeric type. name: Tensor name, and scope for all other ops. Returns: Total loss tensor, or None if no losses have been configured. Raises: ValueError: if losses is missing or empty.