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

Enable fast pass tensor_fill for single element complex tensors #50383

Closed
wants to merge 1 commit into from

Conversation

anjali411
Copy link
Contributor

@anjali411 anjali411 commented Jan 11, 2021

Stack from ghstack:

Differential Revision: D25879881

anjali411 added a commit that referenced this pull request Jan 11, 2021
ghstack-source-id: 6bda69d05f384b92f4914abdd8a5c70a890206f3
Pull Request resolved: #50383
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jan 11, 2021

💊 CI failures summary and remediations

As of commit 2fbe2cb (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 to the (internal) Dr. CI Users group.

This comment has been revised 3 times.

@anjali411 anjali411 added the module: complex Related to complex number support in PyTorch label Jan 11, 2021
@anjali411 anjali411 changed the title Enable fast pass tensor fill for single element complex tensor Enable fast pass tensor_fill for single element complex tensors Jan 11, 2021
@anjali411 anjali411 requested a review from ezyang January 11, 2021 21:53
@@ -18,7 +18,7 @@ Tensor& fill_out(Tensor& self, Scalar value) {
self.copy_(out);
return self;
}
if (self.device() == at::kCPU && self.numel() == 1 && !self.is_complex() && !value.isComplex()) {
if (self.device() == at::kCPU && self.numel() == 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this path actually tested somewhere?

@mruberry
Copy link
Collaborator

mruberry commented Jan 12, 2021

The code changes look good -- is this path actually tested, though? I was looking through test_tensor_creation_ops.py and this may need to add a test for filling tensors with scalars of different dtypes.

@facebook-github-bot
Copy link
Contributor

@anjali411 merged this pull request in 5834438.

@zasdfgbnm zasdfgbnm deleted the gh/anjali411/80/head branch January 12, 2021 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed Merged module: complex Related to complex number support in PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants