def testVariableNamesPreserveNameScopesWithDefun(self):

    @function.defun
    def create_variable():
        with ops.name_scope('foo'):
            v = variables.Variable(0.0, name='bar')
        self.assertEqual(v.name, 'foo/bar:0')
    with ops.get_default_graph().as_default():
        create_variable()
def testVariableNamesPreserveNameScopesWithDefun(self):

    @function.defun
    def create_variable():
        with ops.name_scope('foo'):
            v = variables.Variable(0.0, name='bar')
        self.assertEqual(v.name, 'foo/bar:0')
    with ops.get_default_graph().as_default():
        create_variable()