Repository: pytorch
Issue: [TensorExpr] applying `rfactor` for a Mul Reducer with init value different than 1 results in wrong results
Labels: oncall: jit

### 🐛 Describe the bug

`rfactor` initializes the `rfac_init` with the initializer of the original reduce op.

If the original Reducer uses Mul as the ReduceInteraction with an init value different than 1, the result after `rfactor` will be wrong (the same issue for an Add reducer with an init value different than 0).

https://github.com/pytorch/pytorch/blob/8bd9fe3f493073bf8f4a2e428c3048096fb36052/torch/csrc/jit/tensorexpr/loopnest.cpp#L3380-L3381

### CPP UT to reproduce:
The tensor of size `2 x 8` has values all set to 1.
The reduce axis is the last dim (where `size == 8`).
The Reducer has the init value = 2. The ReduceInteraction is Mul.

The expected result will be `tensor([ 2, 2])`.
With `rfactor`, the result becomes `tensor([ 4, 4])`.

```cpp
TEST(Reductions, ReduceCustomProductWithRfactor) {
  const int M = 2;
  const int N = 8;

  BufHandle b("b", {M, N}, kFloat);
  std::vector<float> in(M * N);
  for (const auto i : c10::irange(M)) {
    for (const auto j : c10::irange(N)) {
      in[i * N + j] = 1;
    }
  }

  std::vector<float> out(M, -1.f);

  Reducer product(
      ExprHandle(2.f), [](ExprHandle a, ExprHandle b) { return a * b; });

  Tensor c = Reduce("product", {M}, product, b, {N});
  LoopNest nest({c});


  // rfactor
  auto loops = nest.getLoopStmtsFor(c);
  ForPtr mi, mo, tail;
  BufPtr rf;  
  constexpr int kChunkSize = 8;
  nest.splitWithTail(loops[1], kChunkSize, &mi, &tail);
  TORCH_CHECK(nest.rfactor(nest.getLoopBodyFor(c), loops[1], &rf));


  nest.prepareForCodegen();
  StmtPtr s = nest.root_stmt();
  s = IRSimplifier::simplify(s);
  std::cout << "final stmt: \n" << *s << "\n";

  SimpleIREvaluator cg(s, {b, c});

  cg.call({in, out});

  float expected = 2;
  for (const auto i : c10::irange(N)) {
    // NOLINTNEXTLINE(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
    expected *= 1;
  }

  for (const auto i : c10::irange(M)) {
    ASSERT_EQ(out[i], expected);
  }
}
```

#### Output log:
```bash
Expected equality of these values:
  out[i]
    Which is: 4
  expected
    Which is: 2
[  FAILED  ] Reductions.ReduceCustomProductWithRfactor (1 ms)
[----------] 1 test from Reductions (1 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] Reductions.ReduceCustomProductWithRfactor

 1 FAILED TEST
```

### Stmt without and with `rfactor`:
The **correct** final stmt without `rfactor`:
```
{
  for (int i = 0; i < 2; i++) {
    product[i] = 2.f;
    for (int i_1 = 0; i_1 < 8; i_1++) {
      product[i] = (product[i]) * (b[i_1 + 8 * i]);
    }
  }
}
```

The **wrong** final stmt with `rfactor`:
```
{
  for (int i = 0; i < 2; i++) {
    product[i] = 2.f;
    product_rfac[i] = 2.f;
    for (int i_inner = 0; i_inner < 8; i_inner++) {
      product_rfac[i] = (product_rfac[i]) * (b[i_inner + 8 * i]);
    }
    product[i] = (product[i]) * (product_rfac[i]);
  }
}
```


### Versions

```
PyTorch version: 1.13.0a0+git8bd9fe3
```