Skip to content

Added autograd tests, disabled jit autograd tests for complex and added a separate list for tests for complex dtype only#38399

Closed
anjali411 wants to merge 5 commits intogh/anjali411/22/basefrom
gh/anjali411/22/head
Closed

Added autograd tests, disabled jit autograd tests for complex and added a separate list for tests for complex dtype only#38399
anjali411 wants to merge 5 commits intogh/anjali411/22/basefrom
gh/anjali411/22/head

Conversation

@anjali411
Copy link
Copy Markdown
Contributor

@anjali411 anjali411 commented May 13, 2020

Stack from ghstack:

Differential Revision: D21555941

…ed a separate list for tests for complex dtype only

[ghstack-poisoned]
…lex and added a separate list for tests for complex dtype only"

[ghstack-poisoned]
@anjali411 anjali411 requested a review from albanD May 13, 2020 15:46
('log1p', uniform_scalar(requires_grad=True), NO_ARGS, 'scalar', (True,)),
('log2', torch.rand(S, S, S) + 1e-2, NO_ARGS, '', (True,)),
('log2', uniform_scalar(1e-2, requires_grad=True), NO_ARGS, 'scalar', (True,)),
('log', torch.randn(S, S, S, dtype=torch.cfloat) + 1e-2, NO_ARGS, 'complex', (True,)),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You have special cases here when the variant name contains "complex" right? Maybe add a comment at the beginning of this list mentioning it. And what is happening for tests that have "complex" in their variant name.

('reciprocal', torch.rand(S, S, S) + 0.1, NO_ARGS, '', (True,)),
('reciprocal', uniform_scalar(0.1, requires_grad=True), NO_ARGS, 'scalar', (True,)),
('reciprocal', torch.randn(S, S, S, dtype=torch.cdouble) + 0.1, NO_ARGS, 'complex', (True,)),
('reciprocal', uniform_scalar(0.1j, requires_grad=True), NO_ARGS, 'complex_scalar', (True,)),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why the original test set requires_grad=True here.
You don't do it for any other tests so I think you can remove it.

Comment thread test/test_autograd.py
Comment thread test/test_autograd.py
test_case.assertEqualTypeString(self_variable, self_variable.grad)
test_case.assertEqual(self_variable.size(), self_variable.grad.size())

separate_complex_tests = ['log', 'log10', 'log1p', 'log2', 'reciprocal']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you add a comment for what this list contains?
These are the ones that run only for complex?

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 13, 2020

💊 CI failures summary and remediations

As of commit 8758a25 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


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 14 times.

anjali411 added 2 commits May 13, 2020 10:18
…lex and added a separate list for tests for complex dtype only"

[ghstack-poisoned]
…lex and added a separate list for tests for complex dtype only"

[ghstack-poisoned]
Copy link
Copy Markdown
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

lgtm

…lex and added a separate list for tests for complex dtype only"

Differential Revision: [D21555941](https://our.internmc.facebook.com/intern/diff/D21555941)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@anjali411 merged this pull request in 1676c7d.

anjali411 added a commit that referenced this pull request May 14, 2020
* #38399 Added autograd tests, disabled jit autograd tests for complex and added a separate list for tests for complex dtype only

[ghstack-poisoned]
anjali411 added a commit that referenced this pull request May 14, 2020
* #38399 Added autograd tests, disabled jit autograd tests for complex and added a separate list for tests for complex dtype only

[ghstack-poisoned]
facebook-github-bot pushed a commit that referenced this pull request May 15, 2020
Summary:
Pull Request resolved: #38400

* #38399 Added autograd tests, disabled jit autograd tests for complex and added a separate list for tests for complex dtype only

Test Plan: Imported from OSS

Differential Revision: D21572209

Pulled By: anjali411

fbshipit-source-id: 7036029e9f8336139f5d54e0dfff9759f3bf8376
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…ed a separate list for tests for complex dtype only (pytorch#38399)

Summary: Pull Request resolved: pytorch#38399

Test Plan: Imported from OSS

Differential Revision: D21555941

Pulled By: anjali411

fbshipit-source-id: ea9f5a76590c5bab3df6a540617b074238bfb535
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#38400

* pytorch#38399 Added autograd tests, disabled jit autograd tests for complex and added a separate list for tests for complex dtype only

Test Plan: Imported from OSS

Differential Revision: D21572209

Pulled By: anjali411

fbshipit-source-id: 7036029e9f8336139f5d54e0dfff9759f3bf8376
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants