[Feature] Checking for dtype to all tensorspec is_in funcs
Description
I've added a check to all is_in functions in TensorSpec for the datatype, as specified in #793.
Motivation and Context
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.
You can use the syntax close #15213 if this solves the issue #15213
Close #793 initially proposed in #783
- [ ] I have raised an issue to propose this change (required for new features and bug fixes)
Types of changes
What types of changes does your code introduce? Remove all that do not apply:
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds core functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation (update in the documentation)
- [ ] Example (update in the folder of examples)
Checklist
Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!
- [x] I have read the CONTRIBUTION guide (required)
- [ ] My change requires a change to the documentation.
- [ ] I have updated the tests accordingly (required for a bug fix or a new feature).
- [ ] I have updated the documentation accordingly.
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/1952
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:x: 23 New Failures
As of commit b1352fbaad549ec933217f96d9533589235d0ed5 with merge base 23bf3151a5bb1377d6ba65c5edb5659618af0da3 ():
NEW FAILURES - The following jobs have failed:
- Continuous Benchmark (PR) / CPU Pytest benchmark (gh)
Workflow failed! Resource not accessible by integration - Continuous Benchmark (PR) / GPU Pytest benchmark (gh)
Workflow failed! Resource not accessible by integration - Habitat Tests on Linux / tests (3.9, 11.6) / linux-job (gh)
RuntimeError: Command docker exec -t 9c5059f594fad86b9f715a4d4a96d4b417122774f83de5432588f246f91170dd /exec failed with exit code 1 - Libs Tests on Linux / unittests-brax (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t c374b5b81ad5b7b1c1074553840b882b8e18da064b38e9e26028934a8cc0a38c /exec failed with exit code 1 - Libs Tests on Linux / unittests-gym (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t 12fa65830d5a2e379e281f68cb8eafa94d9c21a10f6265ceb41efe2a1f302fdc /exec failed with exit code 1 - Libs Tests on Linux / unittests-jumanji (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t 0bbe43cb51b9327c960b3b5dfee4ceab934bbae4c3a1c26b56734ebd81f7f5e5 /exec failed with exit code 1 - Libs Tests on Linux / unittests-pettingzoo / linux-job (gh)
RuntimeError: Command docker exec -t 85ca1efe2999e855c785685e4d940a50240cfa75b130ee5adbcc3ff391eb49cd /exec failed with exit code 1 - Libs Tests on Linux / unittests-robohive (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t 1f0cbe85ff95def376f5a0f450771047cce8bdb2c9d75966bebff53a7c8c9165 /exec failed with exit code 1 - Libs Tests on Linux / unittests-sklearn (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t e9807840b0ed7a69a418dd3345574a933f89752d26aa0e96daab0bb625bfd227 /exec failed with exit code 1 - Libs Tests on Linux / unittests-vmas (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t 18746eccc9769383bdbf8705ed12d13551436b3435dc98a9be2e8bc4126ec7fa /exec failed with exit code 1 - RLHF Tests on Linux / unittests (3.9, 12.1) / linux-job (gh)
test/test_rlhf.py::TestRollout::test_rollout_from_data - Unit-tests on Linux / tests-cpu (3.10) / linux-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on Linux / tests-cpu (3.11) / linux-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on Linux / tests-cpu (3.8) / linux-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on Linux / tests-cpu (3.9) / linux-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on Linux / tests-gpu (3.8, 12.1) / linux-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on Linux / tests-olddeps (3.8, 11.6) / linux-job (gh)
test/test_transforms.py::TestRemoveEmptySpecs::test_trans_parallel_env_check - Unit-tests on Linux / tests-optdeps (3.9, 12.1) / linux-job (gh)
RuntimeError: Command docker exec -t ccf5f98fb85b3215fd78e9935bd898cf8ba1bfdde14a472a6b8663d096dd1e47 /exec failed with exit code 1 - Unit-tests on Linux / tests-stable-gpu (3.8, 11.8) / linux-job (gh)
RuntimeError: Command docker exec -t c37719b40fa7ef4d5d5563b0f000cc4926097eb7595cec925ec537991cf919ed /exec failed with exit code 1 - Unit-tests on MacOS CPU / tests (3.11) / macos-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on MacOS CPU / tests (3.8) / macos-job (gh)
test/test_specs.py::TestSpecMasking::test_is_in[rand_shape2-device0-mult_discrete-shape0] - Unit-tests on Windows / unittests-cpu / windows-job (gh)
Process completed with exit code 1. - Unit-tests on Windows / unittests-gpu / windows-job (gh)
Process completed with exit code 1.
This comment was automatically generated by Dr. CI and updates every 15 minutes.
I've fixed the reviewed changes, and added checks for shape where applicable.