🐛: TensorforceError has no attribute 'dtype'. So fixed typo TensorforceError.dtype -> TensorforceError.type (Bagfix) by HinataKikuchi · Pull Request #880 · tensorforce/tensorforce · GitHub
Skip to content

🐛: TensorforceError has no attribute 'dtype'. So fixed typo TensorforceError.dtype -> TensorforceError.type (Bagfix)#880

Open
HinataKikuchi wants to merge 1 commit intotensorforce:masterfrom
HinataKikuchi:master
Open

🐛: TensorforceError has no attribute 'dtype'. So fixed typo TensorforceError.dtype -> TensorforceError.type (Bagfix)#880
HinataKikuchi wants to merge 1 commit intotensorforce:masterfrom
HinataKikuchi:master

Conversation

@HinataKikuchi
Copy link
Copy Markdown

Hi developers!

As commented in the issue #879, TensorforceError has no attribute 'dtype', but it has 'type' method.
So fixed bellow typo by this PR

def __init__(self, value, *, name=None, dtype=None, min_value=None, max_value=None):
if isinstance(value, bool):
if dtype != 'bool':
raise TensorforceError.dtype(name='Constant', argument='value', dtype=type(value))
elif isinstance(value, int):
if dtype != 'int':
raise TensorforceError.dtype(name='Constant', argument='value', dtype=type(value))
elif isinstance(value, float):
if dtype != 'float':
raise TensorforceError.dtype(name='Constant', argument='value', dtype=type(value))

I really appreciate for your time and effort.

@bOmBeLq
Copy link
Copy Markdown

bOmBeLq commented Nov 5, 2023

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.

2 participants