Skip to content

Conversation

@chriselion
Copy link
Contributor

No description provided.

# repo: https://github.com/chriselion/mypy
# rev: 3d0b6164a9487a6c5cf9d144110b86600fd85e25
# This is a fork with the assert disabled, although precommit has trouble installing it sometimes.
rev: v0.761
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried bumping this to get the errors to show, but no luck. Removed the obsolete comment.


def update_reward_signals(
self, reward_signal_minibatches: Dict[str, Dict], num_sequences: int
self, reward_signal_minibatches: Mapping[str, Dict], num_sequences: int
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was getting Dict[str, AgentBuffer] passed to it, which causes the helpful errors:

ml-agents/mlagents/trainers/sac/trainer.py:322: note: "Dict" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance ml-agents/mlagents/trainers/sac/trainer.py:322: note: Consider using "Mapping" instead, which is covariant in the value type 
self.multi_gpu = multi_gpu
self.seed = seed
self.policy: TFPolicy = None
self.policy: PPOPolicy = None # type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore the error of setting this to None, since we'll always set it to an instance before using.

@chriselion chriselion requested a review from andrewcoh December 30, 2019 21:51
@chriselion chriselion merged commit c806015 into master Dec 30, 2019
@delete-merged-branch delete-merged-branch bot deleted the develop-fix-mypy-trainer branch December 30, 2019 23:17
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants