What is the difference of name scope and a variable scope in tensorflow ?

What is the difference of name scope and a variable scope in tensorflow ?

Asked on November 17, 2018 in Tensorflow.
Add Comment


  • 1 Answer(s)

        The Namespaces are used to sort out names for variables and operators in an hierarchical manner, For example: “scopeA/scopeB/scopeC/op1

    • tf.name_scope makes namespace for operators in the default graph.
    • tf.variable_scope makes namespace for both variables and operators in the default graph.
    • tf.op_scope like tf.name_scope, but for the graph in which specified variables were made.
    • tf.variable_op_scope like tf.variable_scope, but for the graph in which specified variables were made.

        Which shows all types of scopes define namespaces for both variables and operators with following differences:

    • tf.variable_op_scope or tf.variable_scope are good with tf.get_variable
    • tf.op_scope and tf.variable_op_scope simply select a graph from a rundown of determined variables to make a scope for. Other than their behaviour equivalent to tf.name_scope and tf.variable_scope likewise
    • tf.variable_scope and variable_op_scope include indicated or default initializer.
    Answered on November 17, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.