Skip to content

Fix createZerosLike for scalars#8537

Merged
jamesr66a merged 1 commit intopytorch:masterfrom
jamesr66a:zeros_scalar_broadcast
Jun 15, 2018
Merged

Fix createZerosLike for scalars#8537
jamesr66a merged 1 commit intopytorch:masterfrom
jamesr66a:zeros_scalar_broadcast

Conversation

@jamesr66a
Copy link
Collaborator

Solves #8498

Previously, createZerosLike would fail when the operand was a scalar, since we were calling at::zeros to create a 1-dim, 1 element tensor and then expand that out to the proper size. This failed for scalars, since we were attempting to expand a rank-1 tensor to a rank-0 tensor. This fixes that

@jamesr66a jamesr66a merged commit 677739c into pytorch:master Jun 15, 2018
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.

2 participants