-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix an error related to collation and RNN #129
Fix an error related to collation and RNN #129
Conversation
Recurrent policies expect data collated in a tuple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also remove @pytest.mark.skip
at https://github.com/tarokiritani/pfrl/blob/284ed1f43b32654a2ec1569b16a0f6b9acbd5e79/tests/utils_tests/test_batch_states.py#L10 so that the test is run inside CI?
Omitted skipping.
The input feature type is checked better way. Co-authored-by: Yasuhiro Fujita <muupan@gmail.com>
/test |
Successfully created a job for commit 671b6d6: |
It seems the test fails with gpu. Can you apply this patch so it will work with both cpu and gpu? Looks good except this failure. diff --git a/tests/utils_tests/test_batch_states.py b/tests/utils_tests/test_batch_states.py
index ba4391b3..cdfedcd8 100644
--- a/tests/utils_tests/test_batch_states.py
+++ b/tests/utils_tests/test_batch_states.py
@@ -27,7 +27,7 @@ class TestBatchStates(unittest.TestCase):
self.assertIsInstance(batch, tuple)
batch_a, batch_b, batch_c = batch
np.testing.assert_allclose(
- batch_a,
+ batch_a.cpu(),
np.asarray(
[
[[0, 2], [4, 6]],
@@ -35,9 +35,9 @@ class TestBatchStates(unittest.TestCase):
]
),
)
- np.testing.assert_allclose(batch_b, np.asarray([0, 1]))
+ np.testing.assert_allclose(batch_b.cpu(), np.asarray([0, 1]))
np.testing.assert_allclose(
- batch_c,
+ batch_c.cpu(),
np.asarray(
[
[0], |
test_gpu() now correctly uses a GPU.
/test |
Successfully created a job for commit b5f6907: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Recurrent policies expect data collated in a tuple.