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

Make torch.randint have default dtype int64 #11040

Closed
wants to merge 3 commits into from

Conversation

ssnl
Copy link
Collaborator

@ssnl ssnl commented Aug 29, 2018

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SsnL has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ssnl
Copy link
Collaborator Author

ssnl commented Aug 30, 2018

@pytorchbot retest this please

@@ -2853,6 +2853,25 @@ def test_arange_inference(self):
torch.tensor(1, dtype=torch.int16)).dtype)
torch.set_default_dtype(saved_dtype)

def test_randint_inference(self):
saved_dtype = torch.get_default_dtype()
torch.set_default_dtype(torch.float32)

This comment was marked as off-topic.

This comment was marked as off-topic.

auto size = r.intlist(1);
auto generator = r.generator(2);
// NOTE: r.scalartype(X) gives the default dtype if r.isNone(X)
auto dtype = r.isNone(4) ? at::ScalarType::Long : r.scalartype(4);

This comment was marked as off-topic.

auto high = r.toInt64(0);
auto size = r.intlist(1);
// NOTE: r.scalartype(X) gives the default dtype if r.isNone(X)
auto dtype = r.isNone(3) ? at::ScalarType::Long : r.scalartype(3);

This comment was marked as off-topic.

auto high = r.toInt64(1);
auto size = r.intlist(2);
// NOTE: r.scalartype(X) gives the default dtype if r.isNone(X)
auto dtype = r.isNone(4) ? at::ScalarType::Long : r.scalartype(4);

This comment was marked as off-topic.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SsnL is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ssnl ssnl deleted the randint_dtype branch September 9, 2018 00:31
PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
Summary:
cc gchanan apaszke
Pull Request resolved: pytorch#11040

Differential Revision: D9565728

Pulled By: SsnL

fbshipit-source-id: eb5be9609f30c88f52746fa7e13ad71e2856648e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants