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 toDT_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 GraphKeys.REGULARIZATION_LOSSES and can be used for regularization. -
trainable: IfTruealso add the variable to the graph collectionGraphKeys.TRAINABLE_VARIABLES(see tf.Variable). -
collections: A list of collection names to which the Variable will be added. Note that the variable is always also added to theGraphKeys.VARIABLESandGraphKeys.MODEL_VARIABLEScollections. -
caching_device: Optional device string or function describing where the Variable should be cached for reading. Defaults to the Variable's device. -
device: Optional device to place the variable. It can be an string or a function that is called to get the device for the variable.
Returns:
The created or existing variable.
Please login to continue.