Skip to content
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

ht.randn(): unit test expects pytorch to detect malformed input #58

Closed
d1saster opened this issue Oct 17, 2018 · 0 comments
Closed

ht.randn(): unit test expects pytorch to detect malformed input #58

d1saster opened this issue Oct 17, 2018 · 0 comments

Comments

@d1saster
Copy link
Member

The unit test that checks whether ht.randn throws a ValueError depends on the fact that pytorch
shall detect malformed input. Unfortunately, this is not the case for my pytorch installation (trying to print the resulting tensor, however, results in an infinite loop, such that we can be sure that pytorch does not magically know how to handle negative dimensions ... )

For completeness the pytest output:

        with self.assertRaises(ValueError):
>           ht.randn(-1, 3, dtype=ht.float64)
E           AssertionError: ValueError not raised

heat/core/tests/test_tensor.py:278: AssertionError

There seems to be already some all_ints variable available in ht.randn, which could be augmented to also check for positive arguments?

d1saster pushed a commit that referenced this issue Oct 17, 2018
So far ht.randn leaves the input checking mostly to pytorch.
This patch modifies ht.randn to at least check some of the
argument properties itself.

Fixes #58
Markus-Goetz added a commit that referenced this issue Oct 18, 2018
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

No branches or pull requests

1 participant