def testDuplicateTemporaryVariable(self):
    with self.test_session(use_gpu=True):
        var1 = gen_state_ops._temporary_variable([1, 2], dtypes.float32, var_name='dup')
        var1 = state_ops.assign(var1, [[1.0, 2.0]])
        var2 = gen_state_ops._temporary_variable([1, 2], dtypes.float32, var_name='dup')
        var2 = state_ops.assign(var2, [[3.0, 4.0]])
        final = (var1 + var2)
        with self.assertRaises(errors.AlreadyExistsError):
            final.eval()
def testDuplicateTemporaryVariable(self):
    with self.test_session(use_gpu=True):
        var1 = gen_state_ops._temporary_variable([1, 2], dtypes.float32, var_name='dup')
        var1 = state_ops.assign(var1, [[1.0, 2.0]])
        var2 = gen_state_ops._temporary_variable([1, 2], dtypes.float32, var_name='dup')
        var2 = state_ops.assign(var2, [[3.0, 4.0]])
        final = (var1 + var2)
        with self.assertRaises(errors.AlreadyExistsError):
            final.eval()