def testAssignDifferentShapesEagerNotAllowed(self):
    with context.eager_mode():
        var = variables.Variable(np.zeros(shape=[1, 1]))
        with self.assertRaisesRegex(ValueError, 'Shapes.*and.*are incompatible'):
            var.assign(np.zeros(shape=[2, 2]))
def testAssignDifferentShapesEagerNotAllowed(self):
    with context.eager_mode():
        var = variables.Variable(np.zeros(shape=[1, 1]))
        with self.assertRaisesRegex(ValueError, 'Shapes.*and.*are incompatible'):
            var.assign(np.zeros(shape=[2, 2]))