def test_invalid_mode(self):
        """Test that invalid rematerialization modes raise an error."""
        with self.assertRaises(ValueError):
            RematScope(mode="invalid")  # Invalid mode should raise ValueError
Test that invalid rematerialization modes raise an error.
keras/src/backend/common/remat_test.py