Skip to content

Commit

Permalink
Revert "Only truncate leading 1s if the value is too big. (#94521)"
Browse files Browse the repository at this point in the history
This reverts commit 03f4a63.

Reverted #94521 on behalf of https://github.com/ezyang due to fails internal tests
  • Loading branch information
pytorchmergebot committed Feb 19, 2023
1 parent 06489a3 commit f89ae0a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions torch/csrc/autograd/python_variable_indexing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,7 @@ int THPVariable_setitem(PyObject* self, PyObject* index, PyObject* py_value) {
pybind11::gil_scoped_release no_gil;
SymIntArrayRef valueSizes = value.sym_sizes();
SymIntArrayRef slicedValueSizes =
static_cast<int64_t>(valueSizes.size()) > sliced.dim()
? at::indexing::slicePrefix1sSize(valueSizes)
: valueSizes;
at::indexing::slicePrefix1sSize(valueSizes);
torch::autograd::Variable valuesSliced;
if (!valueSizes.equals(slicedValueSizes)) {
valuesSliced = value.view_symint(slicedValueSizes);
Expand Down

0 comments on commit f89ae0a

Please sign in to comment.