burn
burn copied to clipboard
Implement missing tensor unit tests
During a recent PR code review, @agelas found missing of certain unit tests (such as unsqueeze). This ticket is identify the missing tests and implement them.
- Identify and document the missing unit tests.
- Create and implement these unit tests, then cross-verify the results with a deep learning tool like PyTorch.
If you're not sure how to add a unit test for a tensor, here are the steps:
- Include the test under
burn-tensor/src/tests/ops. - Insert the module under
burn-tensor/src/tests/ops/mod.rs. - Adjust
burn-tensor/src/tests/mod.rsto include the new macro call.
For a practical example, take a look at this PR, which implemented the flatten test: https://github.com/burn-rs/burn/pull/260/files.
Hi is this something I could work on?
Hi is this something I could work on?
Yes, please!
I am having a hard time getting the integration tests to run. Running cargo test just does not discover the tests in the burn-tensor/src/tests directory. Do I have to run cargo test with some specific feature flag or something else? I don't quite understand the testgen macro.
@FjodorGit, you will need to run tests for each backend. For example, if you need to test with ndarray, you'll need cd to burn-ndarray and run cargo test. The tests are imported. By itself, burn-tensor can't use a backend.
Let us know if you need more help.
Oh ok I see. Thank you for your help.
I guess it is intentional that the tests don't run for the candle backend?
OK. Closing this as it's too generic. We need to identify missing tests and add them as we go.