What is the difference between variable_ops_scope and variable_scope?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-16 05:38:36

问题


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:

  1. Validate that values come from the same graph

  2. If name_or_scope is None, the default_name will be used and will be uniquified if needed. Note that, if name_or_scope is not None, it will be used and but not be uniquified, and default_name will not be used.



来源:https://stackoverflow.com/questions/38841380/what-is-the-difference-between-variable-ops-scope-and-variable-scope

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!