Skip to content

Commit c56f769

Browse files
kshitij12345zou3519
authored andcommitted
[functorch] replace reshape with view (pytorch/functorch#304)
1 parent 7bb6047 commit c56f769

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functorch/functorch/csrc/BatchRulesScatterOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ Tensor get_expanded_index(const Tensor& index, IntArrayRef self_size, int64_t di
387387
{
388388
VmapDimVector new_index_shape(self_size.size(), 1);
389389
new_index_shape[dim] = idx_size;
390-
index_ = index.reshape(new_index_shape);
390+
index_ = index.view(new_index_shape);
391391
}
392392
// Now apply expand to index_
393393
{

0 commit comments

Comments
 (0)