问题
In TensorFlow, there are two scope functions: variable_ops_scope
and variable_scope
. The first one has a signature as following:
variable_op_scope(values, name_or_scope, default_name,initializer,
regularizer, caching_device, partitioner, reuse)
What does the first parameter values
mean? default_name
is only used when name_or_scope
is None
, so why this function need to take these two parameters? One parameter should be enough.
In general, what is the difference between these two scopes?
回答1:
variable_ops_scope
is a wrapper for variable_scope
. Just like tf.variable_scope
, but performs 2 more things:
Validate that values come from the same graph
If
name_or_scope
isNone
, thedefault_name
will be used and will be uniquified if needed. Note that, ifname_or_scope
is notNone
, it will be used and but not be uniquified, anddefault_name
will not be used.
来源:https://stackoverflow.com/questions/38841380/what-is-the-difference-between-variable-ops-scope-and-variable-scope