tf.compat.v1.VariableScope

View source on GitHub

Variable scope object to carry defaults to provide to get_variable.

tf.compat.v1.VariableScope(
    reuse, name='', initializer=None, regularizer=None, caching_device=None,
    partitioner=None, custom_getter=None, name_scope='', dtype=tf.dtypes.float32,
    use_resource=None, constraint=None
)

Many of the arguments we need for get_variable in a variable store are most easily handled with a context. This object is used for the defaults.

Attributes:

Methods

get_collection

View source

get_collection(
    name
)

Get this scope's variables.

get_variable

View source

get_variable(
    var_store, name, shape=None, dtype=None, initializer=None, regularizer=None,
    reuse=None, trainable=None, collections=None, caching_device=None,
    partitioner=None, validate_shape=True, use_resource=None, custom_getter=None,
    constraint=None, synchronization=tf.VariableSynchronization.AUTO,
    aggregation=tf.compat.v1.VariableAggregation.NONE
)

Gets an existing variable with this name or create a new one.

global_variables

View source

global_variables()

Get this scope's global variables.

local_variables

View source

local_variables()

Get this scope's local variables.

reuse_variables

View source

reuse_variables()

Reuse variables in this scope.

set_caching_device

View source

set_caching_device(
    caching_device
)

Set caching_device for this scope.

set_custom_getter

View source

set_custom_getter(
    custom_getter
)

Set custom getter for this scope.

set_dtype

View source

set_dtype(
    dtype
)

Set data type for this scope.

set_initializer

View source

set_initializer(
    initializer
)

Set initializer for this scope.

set_partitioner

View source

set_partitioner(
    partitioner
)

Set partitioner for this scope.

set_regularizer

View source

set_regularizer(
    regularizer
)

Set regularizer for this scope.

set_use_resource

View source

set_use_resource(
    use_resource
)

Sets whether to use ResourceVariables for this scope.

trainable_variables

View source

trainable_variables()

Get this scope's trainable variables.