Skip to content

Commit

Permalink
Change generator type to iterator
Browse files Browse the repository at this point in the history
This is a bit cleaner. As reccomended by an internal (to Google) static
python analysis tool.
  • Loading branch information
boomanaiden154 committed Feb 15, 2025
1 parent dc93b3d commit 0dfe312
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import contextlib
import gin
from typing import Any
from collections.abc import Callable, Generator
from collections.abc import Callable, Iterator
import json

from absl import flags
Expand Down Expand Up @@ -518,8 +518,7 @@ def explore_at_state_generator(
policy: Callable[[time_step.TimeStep | None], np.ndarray],
explore_policy: Callable[[time_step.TimeStep], policy_step.PolicyStep],
num_samples: int = 1,
) -> Generator[tuple[tf.train.SequenceExample, ExplorationWithPolicy], None,
None]:
) -> Iterator[tuple[tf.train.SequenceExample, ExplorationWithPolicy]]:
"""Generate sequence examples and next exploration policy while exploring.
Generator that defines how to explore at the given explore_step. This
Expand Down

0 comments on commit 0dfe312

Please sign in to comment.