Skip to content

Properly fill in make_non_contiguous data for sizes that can't be mad… - #4951

Merged
ezyang merged 2 commits into
pytorch:masterfrom
gchanan:nan_problem_fix
Jan 31, 2018
Merged

ezyang merged 2 commits into
pytorch:masterfrom
gchanan:nan_problem_fix

Conversation

@gchanan

@gchanan gchanan commented Jan 30, 2018

Copy link
Copy Markdown
Contributor

…e contiguous.

@gchanan

gchanan commented Jan 30, 2018

Copy link
Copy Markdown
Contributor Author

This is a silly error and should fix the mac tests.

Comment thread torch/testing/__init__.py Outdated
def make_non_contiguous(tensor):
if tensor.numel() <= 1: # can't make non-contiguous
return tensor.new(tensor.size())
return tensor.new(tensor.size()).copy_(tensor)

This comment was marked as off-topic.

@gchanan

gchanan commented Jan 30, 2018

Copy link
Copy Markdown
Contributor Author

this doesn't seem sufficient to fix the mac issues yet.

@gchanan

gchanan commented Jan 30, 2018

Copy link
Copy Markdown
Contributor Author

actually, it does fix it (my Mac install was messed up).

@ezyang
ezyang merged commit 3ac412e into pytorch:master Jan 31, 2018
gchanan added a commit to gchanan/pytorch that referenced this pull request Jan 31, 2018
pytorch#4951)

* Properly fill in make_non_contiguous data for sizes that can't be made contiguous.

* Use clone instead of copy.
gchanan added a commit that referenced this pull request Feb 1, 2018
#4953)

* Add scalar autograd tests for functions requiring 'special' Variables on LHS.

* Add index_* tests.

* Fix flake8.

* Use normal for clamp rather than uniform.

* Add tests for gather, scatter, scatter_add.

* Make sure masked_select doesn't get all zeros.

* Properly fill in make_non_contiguous data for sizes that can't be mad… (#4951)

* Properly fill in make_non_contiguous data for sizes that can't be made contiguous.

* Use clone instead of copy.

* Fix and test backward for mv, ger with scalars.

* Fix addmv.

* Use grad.type() instead of type(grad).

* Fix addr.

There are a couple of hacks here:
1) We need to squeeze the backward result because of implicit broadcast of the arguments to match behavior of ger.
2) The broadcast_dims code doesn't work for scalars; I added support for adding '.scalar' onto the end of the broadcast
   specification, but really this should just be a native function with _out support.

* Don't allow scalars in torch.dot for Variables.

There is no dot_out, so the lack of _out isn't an issue.

* Revert "Don't allow scalars in torch.dot for Variables."

This reverts commit 76c521e.

* Revert "Fix addr."

This reverts commit afe04a0.

* Revert "Fix addmv."

This reverts commit 550c7ac.

* Revert "Use grad.type() instead of type(grad)."

This reverts commit ddcb5a4.

* Revert "Fix and test backward for mv, ger with scalars."

This reverts commit 10b0eca.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants