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

Fix complex tensor printing #38031

Closed
wants to merge 4 commits into from
Closed

Conversation

anjali411
Copy link
Contributor

@anjali411 anjali411 commented May 7, 2020

Stack from ghstack:

Differential Revision: D21502915

[ghstack-poisoned]
anjali411 added a commit that referenced this pull request May 7, 2020
ghstack-source-id: 652f9f010150fd1a188392751282e2b8f699d1b9
Pull Request resolved: #38031
@@ -280,7 +280,9 @@ def _str(self):
or (self.device.type == 'cuda' and torch.cuda.current_device() != self.device.index):
suffixes.append('device=\'' + str(self.device) + '\'')

has_default_dtype = self.dtype in (torch.get_default_dtype(), torch.int64, torch.bool)
# TODO: add an API to map real -> complex dtypes
_default_complex_dtype = torch.cfloat if torch.get_default_dtype() == torch.float else torch.cdouble
Copy link
Collaborator

Choose a reason for hiding this comment

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

so if default dtype is half this is cdouble?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point! no it should be cdouble if double else cfloat, similar to the logic here

Copy link
Contributor Author

@anjali411 anjali411 May 7, 2020

Choose a reason for hiding this comment

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

will update! updated

@dr-ci
Copy link

dr-ci bot commented May 7, 2020

💊 CI failures summary and remediations

As of commit 8b2acc1 (more details on the Dr. CI page):


  • 2/2 failures possibly* introduced in this PR
    • 2/2 non-CircleCI failure(s)

Extra GitHub checks: 1 failed


ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker.

See how this bot performed.

This comment has been revised 6 times.

@anjali411 anjali411 requested a review from ssnl May 11, 2020 14:59
anjali411 added a commit that referenced this pull request May 11, 2020
ghstack-source-id: 34bfb5c5632302258f29eb29a199dc49302ca8d6
Pull Request resolved: #38031
@anjali411 anjali411 requested a review from ezyang May 11, 2020 14:59
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Test please? :)

@anjali411 anjali411 changed the title Fix tensor printing Fix complex tensor printing May 11, 2020
@anjali411 anjali411 added the module: complex Related to complex number support in PyTorch label May 11, 2020
anjali411 added a commit that referenced this pull request May 12, 2020
ghstack-source-id: 96c5973dedb918eea36a825c1d04737c9268b059
Pull Request resolved: #38031
@facebook-github-bot
Copy link
Contributor

@anjali411 merged this pull request in 375ddb0.

@facebook-github-bot facebook-github-bot deleted the gh/anjali411/17/head branch May 15, 2020 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged module: complex Related to complex number support in PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants