Skip to content

codemod tensor.type().is_cuda(), tensor.type().is_sparse()#13590

Closed
zou3519 wants to merge 1 commit intopytorch:masterfrom
zou3519:remove-more-type
Closed

codemod tensor.type().is_cuda(), tensor.type().is_sparse()#13590
zou3519 wants to merge 1 commit intopytorch:masterfrom
zou3519:remove-more-type

Conversation

@zou3519
Copy link
Copy Markdown
Contributor

@zou3519 zou3519 commented Nov 5, 2018

Followup to #12841

Changed these to not require type dispatch:
tensor.type().is_cuda() -> tensor.is_cuda()
tensor.type().is_sparse() -> tensor.is_sparse()
isVariable(tensor.type()) -> tensor.is_variable()

This probably does not affect performance
very much in most cases but it is nice to have.

Changed these to not require type dispatch:
tensor.type().is_cuda() -> tensor.is_cuda()
tensor.type().is_sparse() -> tensor.is_sparse()
isVariable(tensor.type()) -> tensor.is_variable()

This probably does not affect performance
very much in most cases but it is nice to have.
@zou3519 zou3519 requested review from ezyang and gchanan November 5, 2018 20:55
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Nov 5, 2018
Copy link
Copy Markdown
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.

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

@zou3519 zou3519 mentioned this pull request Nov 5, 2018
21 tasks
@yf225
Copy link
Copy Markdown
Contributor

yf225 commented Nov 5, 2018

@pytorchbot retest this please

1 similar comment
@zou3519
Copy link
Copy Markdown
Contributor Author

zou3519 commented Nov 6, 2018

@pytorchbot retest this please

Copy link
Copy Markdown
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.

Thank you, any patch that removes type() call is a win in my book.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Nov 7, 2018
Summary:
Followup to #12841

Changed these to not require type dispatch:
tensor.type().is_cuda() -> tensor.is_cuda()
tensor.type().is_sparse() -> tensor.is_sparse()
isVariable(tensor.type()) -> tensor.is_variable()

This probably does not affect performance
very much in most cases but it is nice to have.
Pull Request resolved: pytorch/pytorch#13590

Reviewed By: ezyang

Differential Revision: D12929301

Pulled By: zou3519

fbshipit-source-id: 8ac5c6200c579dd7a44fb4ee58fc9bb170feb1d7
@ezyang ezyang added the merged label Jun 25, 2019
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…3590)

Summary:
Followup to pytorch#12841

Changed these to not require type dispatch:
tensor.type().is_cuda() -> tensor.is_cuda()
tensor.type().is_sparse() -> tensor.is_sparse()
isVariable(tensor.type()) -> tensor.is_variable()

This probably does not affect performance
very much in most cases but it is nice to have.
Pull Request resolved: pytorch#13590

Reviewed By: ezyang

Differential Revision: D12929301

Pulled By: zou3519

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

Labels

oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants