Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 551829316
Change-Id: I9473880dbaa081db97d5647ae0dd56b014a1b6fc
  • Loading branch information
jagapiou authored and Copybara-Service committed Jul 28, 2023
1 parent b380cb1 commit f6dcd2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions meltingpot/testing/mocks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def test_value_from_specs(self):
)
actual = mocks._values_from_specs(specs)
expected = (
{'a': np.zeros([1, 2, 3], dtype=np.uint8) + 0},
{'b': np.zeros([1, 2, 3], dtype=np.uint8) + 1},
{'a': np.zeros([1, 2, 3], dtype=np.uint8)},
{'b': np.ones([1, 2, 3], dtype=np.uint8)},
)
np.testing.assert_equal(actual, expected)

Expand All @@ -44,7 +44,10 @@ def test_mock_substrate(self):
num_actions=num_actions,
observation_spec=observation_spec)

expected_observation = ({'a': np.uint8()}, {'a': np.uint8() + 1})
expected_observation = (
{'a': np.zeros([], dtype=np.uint8)},
{'a': np.ones([], dtype=np.uint8)},
)
expected_reward = tuple(float(n) for n in range(num_players))

with self.subTest('is_substrate'):
Expand Down
2 changes: 1 addition & 1 deletion meltingpot/utils/policies/saved_model_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __init__(self, model_path: str, device_name: str = 'cpu') -> None:

@contextlib.contextmanager
def _build_context(self):
with self._graph.as_default():
with self._graph.as_default(): # pylint: disable=not-context-manager
with tf.compat.v1.device(self._device_name):
yield

Expand Down

0 comments on commit f6dcd2e

Please sign in to comment.