Skip to content

Commit

Permalink
Update on "[functorch] Prevent using for-loop for out-of-place index_…
Browse files Browse the repository at this point in the history
…fill batch rule"


A follow-up PR for #91364 (comment)


[ghstack-poisoned]
  • Loading branch information
qqaatw committed Apr 17, 2023
1 parent 13d1776 commit 7f62fac
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion aten/src/ATen/functorch/BatchRulesScatterOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,6 @@ std::tuple<Tensor,optional<int64_t>> index_fill_int_tensor_batch_rule_impl(
// `self_` having an incompatible stride without copying.
// If value has a batch dim, we do for-loop as well because
// index_fill_ supports 1-element tensor only.
value_ = ensure_has_bdim(value_, value_bdim.has_value(), batch_size);
for (const auto i : c10::irange(0, batch_size)) {
const auto& self_slice = self_.select(0, i);
const auto& index_slice = index_.select(0, i);
Expand Down

0 comments on commit 7f62fac

Please sign in to comment.