def test_shared_state0(self):
        a = T.scalar()  # the a is for 'anonymous' (un-named).
        x, s = T.scalars('xs')

        f = function([x, In(a, value=1.0, name='a'), In(s, value=0.0, update=s+a*x, mutable=True)], s+a*x)
        g = function([x, In(a, value=1.0, name='a'), In(s, value=f.container[s], update=a*x-s, mutable=True)], s+a*x)

        f(1, 2)
        self.assertTrue(f[s] == 2)
        self.assertTrue(g[s] == 2)
        g(1, 2)
        self.assertTrue(f[s] == 0)
        self.assertTrue(g[s] == 0)
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/compile/tests/test_function_module.py/T_function.test_shared_state0/swapped operands of `-`