tf.contrib.graph_editor.add_control_inputs()

tf.contrib.graph_editor.add_control_inputs(op, cops) Add the control inputs cops to co. Warning: this function is directly manipulating the internals of the tf.Graph. Args: op: a tf.Operation to which the control inputs are added. 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 already a control input of op.

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.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.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.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.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.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.

tf.contrib.framework.model_variable()

tf.contrib.framework.model_variable(*args, **kwargs) Gets an existing model 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 colle

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.