Repository: pytorch
Issue: [nnc] Compute expressions with > 4 axes is pretty tedious
Labels: oncall: jit,NNC

With a seven-axis convolution my tensor body function has to spend a lot of lines of code unpacking the VarHandle vector into sensibly named arguments.  I wonder if there's a way to have a varargs lambda, or at least some nice axis unpacking thingie, `std::tie(n, k, oh, ow, c, r, s) = axes` would be OK, for instance.
```
  Tensor* conv = Reduce(
      "conv",
      {{N, "n"}, {OH, "oh"}, {OW, "ow"}, {K, "k"}},
      Sum(),
      // FIXME: We have to use a `std::vector` parameter here and then unpack                                                                                                                                                                                                                                                                                                                                                                                                             
      // it, because we don't have an overload allowing for an arbitrary number                                                                                                                                                                                                                                                                                                                                                                                                           
      // of ExprHandle/VarHandle parameters.                                                                                                                                                                                                                                                                                                                                                                                                                                              
      [&](const std::vector<VarHandle>& v) {
        auto const& n = v[0];
        auto const& k = v[1];
        auto const& oh = v[2];
        auto const& ow = v[3];
        auto const& c = v[4];
        auto const& r = v[5];
        auto const& s = v[6];
        return IP.load(n, oh + r, ow + s, c) * WP.load(c, r, s, k);
      },
      // FIXME: If you forget one of the reduction dims, you get a segfault.                                                                                                                                                                                                                                                                                                                                                                                                              
      // Could that be caught by a verifier?                                                                                                                                                                                                                                                                                                                                                                                                                                              
      {{C, "c"}, {R, "r"}, {S, "s"}});
```

For that matter, even with <4 axes, the lambda signature args of (const VarHandle& a, const VarHandle& b, ...) is pretty verbose.  Is VarHandle a value type?  Maybe passing by const& is unnecessary?  Maybe VarHandle is too many characters?  (This is all minor compared to the unpacking bit, just related).


cc @gmagogsfm