Skip to content

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

Open
HinataKikuchi wants to merge 1 commit into
tensorforce:masterfrom
HinataKikuchi:master
Open

🐛: TensorforceError has no attribute 'dtype'. So fixed typo TensorforceError.dtype -> TensorforceError.type (Bagfix)#880
HinataKikuchi wants to merge 1 commit into
tensorforce: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

if isinstance(initial_value, int):
if dtype != 'int':
raise TensorforceError.dtype(
name='Decaying', argument='initial_value', dtype=type(initial_value)
)
elif isinstance(initial_value, float):
if dtype != 'float':
raise TensorforceError.dtype(
name='Decaying', argument='initial_value', dtype=type(initial_value)
)

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

Heads up. Just ran into this issue.

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