Skip to content

Fix type hint#183

Open
daikikatsuragawa wants to merge 1 commit into
st-tech:masterfrom
daikikatsuragawa:master
Open

Fix type hint#183
daikikatsuragawa wants to merge 1 commit into
st-tech:masterfrom
daikikatsuragawa:master

Conversation

@daikikatsuragawa
Copy link
Copy Markdown

Signed-off-by: Daiki Katsuragawa 50144563+daikikatsuragawa@users.noreply.github.com

I read that the return type of _estimate_policy_gradient is not float but torch.Tensor (array-like).

I checked with mypy in an experiment.

mypy --ignore-missing-imports --disallow-untyped-def --warn-unreachable obp

Then the following error occurs.

obp/policy/offline_continuous.py:481: error: "float" has no attribute "mean"  [attr-defined]
obp/policy/offline_continuous.py:504: error: "float" has no attribute "mean"  [attr-defined]

This means that float is specified as the return type of _estimate_policy_gradient, but float has no method named mean.

Signed-off-by: Daiki Katsuragawa <50144563+daikikatsuragawa@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant