Repository: pytorch/functorch (language: python)

Issue:
Actually actionable list of batching rules to write
For each of the items here, we should make sure all compositions (vmap, vmap x vjp) have a batching rule. All of these items should be actionable (in that it is possible to write a batching rule and we are not blocked on functionalization, which is coming soon).

Note: you may need to write an OpInfo for the operator if it doesn't exist already or wait for one to be added. A lot of folks are adding OpInfos right now, so if the OpInfo doesn't exist please ask first to see if someone is working on it.

Note: if any of the operations decompose into in-place operations, then we need functionalization to handle them. I think I've already filtered out all of those, but please check me on that.

Parcel 1: top nn.functional.* and top torch.* foo
- [x] torch.nn.functional.interpolate (this involves adding batching rules for adaptive_avg_pool1d, but we might as well do `adaptive_avg_pool{1, 2, 3}d` as well as their backward variants while we're at it)
- [x] nn.functional.unfold. Involves writing a batching rule for im2col im2col_backward (https://github.com/pytorch/functorch/pull/262)
- [x] nn.functional.grid_sample. Involves writing a batching rule for the backward operator. @vfdev-5 
- [x] torch.pow. The backward needs batching rule for logical_and ; use this as an opportunity to write the batching rules for `logical_{and, or, xor}` if those don't exist yet. We may need to also add a change to PyTorch core to make the logical_* functions primitives w.r.t. autograd

Parcel 2: new_blah
- [x] new_empty, new_full, new_ones, new_zeros, empty_like, zeros_like, ones_like, full_like
- [x] `adaptive_max_pool{1, 2, 3}d` as well as the backward variants
- [x] diagonal_scatter, select_scatter, slice_scatter @kshitij12345 
- [ ] linalg.householder_product (forward pass only)
- [x] pixel_shuffle, pixel_unshuffle (these might just be OP_DECOMPOSE)
- [x] isinf, isfinite, isnan
- [x] _cdist_forward, _cdist_backward (try to write a batching rule if possible. If not possible, we may need to write a decomposition) @vfdev-5 

Parcel 3: linalg things
- [x] _lu_with_info (forward pass only) @vfdev-5 
- [x] linalg.eig (forward pass only) @vfdev-5 
- [x] torch.addr @vfdev-5 
- [x] cholesky_solve (forward pass only) @vfdev-5 

Parcel 4:
- [x] ~~index_select, index_copy, etc, all need a backward formula in pytorch/pytorch https://github.com/pytorch/functorch/issues/260~~


Discussion / hints:
@zou3519 `nn.functional.pad` with circular option requires to do a copy: `out[..., out_d0:out_d1] = input[..., in_d0:in_d1]` and thus there is the following error is raised:
```
>           out[..., out_d0:out_d1] = input[..., in_d0:in_d1]                                                                                                                               
E           RuntimeError: vmap: aten::copy_(self, *extra_args) is not possible because there exists a Tensor `other` in extra_args that has more elements than `self`. This happened due to `other` being vmapped over but `self` not being vmapped over at level 2. Please try to use out-of-place operators instead of aten::copy_. If said operator is being called inside the PyTorch framework, please file a bug report instead. 
```
Can we do something with that ?
Aha. Nope, we can't do anything about that until functionalization is in, good catch.
Hi @zou3519, the "forward pass only" ops above means that the vjp and related operators require the functionalization too?
> Hi @zou3519, the "forward pass only" ops above means that the vjp and related operators require the functionalization too?

Yes, "forward pass only" means we should only try to get the `vmap` tests passing and none of the vjp/grad/compositions of {vjp, grad} tests.

Fix patch:
diff --git a/codegen/codegen_outofplacebatching.py b/codegen/codegen_outofplacebatching.py
index 6ecaca3a6..63a018c19 100644
--- a/codegen/codegen_outofplacebatching.py
+++ b/codegen/codegen_outofplacebatching.py
@@ -157,7 +157,9 @@ def parse_return(return_t):
     return tuple([x.strip() for x in m.group(1).split(',')])
 
 def parse_args(args_t):
-    args = args_t.split(',')
+    # There is an assumption made that args are separated with comma-space
+    # and types like std::array<bool,2> do not contain spaces after the comma
+    args = args_t.split(', ')
     result = []
     for arg in args:
         split_idx = arg.rfind(' ')
@@ -172,8 +174,6 @@ def get_signatures(path='build/aten/src/ATen/RegistrationDeclarations.h', includ
     for line in lines:
         if 'void' in line:
             continue
-        if 'std::array' in line:
-            continue
         m = re.match(r'(.*) \w+\((.*)\); // {"schema": "aten::(\w+\.?\w*)\(.*', line)
         if m is None:
             continue
diff --git a/functorch/csrc/BatchRulesModules.cpp b/functorch/csrc/BatchRulesModules.cpp
index 127c10ea0..d8cf06f85 100644
--- a/functorch/csrc/BatchRulesModules.cpp
+++ b/functorch/csrc/BatchRulesModules.cpp
@@ -255,6 +255,86 @@ grid_sample_batch_rule(const Tensor& input, optional<int64_t> input_bdim, const
   return result;
 }
 
+std::tuple<Tensor, Tensor, Tensor, int64_t>
+grid_sample_backward_helper_in(
+    const Tensor& grad_output, optional<int64_t> grad_output_bdim,
+    const Tensor& input, optional<int64_t> input_bdim,
+    const Tensor& grid, optional<int64_t> grid_bdim) {
+
+  auto batch_size = get_bdim_size3(
+      grad_output, grad_output_bdim, input, input_bdim, grid, grid_bdim);
+
+  auto grad_output_ = moveBatchDimToFront(grad_output, grad_output_bdim);
+  grad_output_ = ensure_has_bdim(grad_output_, grad_output_bdim.has_value(), batch_size);
+  grad_output_ = reshape_dim_into(0, 0, grad_output_);
+
+  auto input_ = moveBatchDimToFront(input, input_bdim);
+  input_ = ensure_has_bdim(input_, input_bdim.has_value(), batch_size);
+  input_ = reshape_dim_into(0, 0, input_);
+
+  auto grid_ = moveBatchDimToFront(grid, grid_bdim);
+  grid_ = ensure_has_bdim(grid_, grid_bdim.has_value(), batch_size);
+  grid_ = reshape_dim_into(0, 0, grid_);
+
+  return std::make_tuple(grad_output_, input_, grid_, batch_size);
+}
+
+std::tuple<Tensor, optional<int64_t>, Tensor, optional<int64_t>>
+grid_sample_backward_helper_out(
+    const std::tuple<Tensor, Tensor> & bw_out,
+    optional<int64_t> grad_input_out_bdim,
+    optional<int64_t> grad_grid_out_bdim,
+    int64_t bdim_size) {
+  auto grad_input = std::get<0>(bw_out);
+  auto grad_grid = std::get<1>(bw_out);
+  grad_input = reshape_dim_outof(*grad_input_out_bdim, bdim_size, grad_input);
+  grad_grid = reshape_dim_outof(*grad_grid_out_bdim, bdim_size, grad_grid);
+  auto result = std::make_tuple(grad_input, grad_input_out_bdim, grad_grid, grad_grid_out_bdim);
+  return result;
+}
+
+
+template<typename F, F Func, typename... ExtraArgs>
+std::tuple<Tensor, optional<int64_t>, Tensor, optional<int64_t>>
+grid_sample_backward_batch_rule(
+    const Tensor& grad_output, optional<int64_t> grad_output_bdim,
+    const Tensor& input, optional<int64_t> input_bdim,
+    const Tensor& grid, optional<int64_t> grid_bdim,
+    ExtraArgs... extra_args) {
+
+  auto new_bw_input = grid_sample_backward_helper_in(
+      grad_output, grad_output_bdim, input, input_bdim, grid, grid_bdim);
+
+  auto new_grad_output = std::get<0>(new_bw_input);
+  auto new_input = std::get<1>(new_bw_input);
+  auto new_grid = std::get<2>(new_bw_input);
+  int64_t batch_size = std::get<3>(new_bw_input);
+
+  auto bw_out = Func(new_grad_output, new_input, new_grid, std::forward<ExtraArgs>(extra_args)...);
+
+  return grid_sample_backward_helper_out(bw_out, 0, 0, batch_size);
+}
+
+template<typename F, F Func>
+std::tuple<Tensor, optional<int64_t>, Tensor, optional<int64_t>>
+cudnn_grid_sample_backward_batch_rule(
+    const Tensor& input, optional<int64_t> input_bdim,
+    const Tensor& grid, optional<int64_t> grid_bdim,
+    const Tensor& grad_output, optional<int64_t> grad_output_bdim) {
+
+  auto new_bw_input = grid_sample_backward_helper_in(
+      grad_output, grad_output_bdim, input, input_bdim, grid, grid_bdim);
+
+  auto new_grad_output = std::get<0>(new_bw_input);
+  auto new_input = std::get<1>(new_bw_input);
+  auto new_grid = std::get<2>(new_bw_input);
+  int64_t bdim_size = std::get<3>(new_bw_input);
+
+  auto bw_out = Func(new_input, new_grid, new_grad_output);
+
+  return grid_sample_backward_helper_out(bw_out, 0, 0, bdim_size);
+}
+
 std::tuple<Tensor, optional<int64_t>> cross_batch_rule(
     const Tensor& self, optional<int64_t> self_bdim,
     const Tensor& other, optional<int64_t> other_bdim,
@@ -370,12 +450,53 @@ struct GridSampleBatchRuleHelper<F, Func, typelist<T1, T2, T...>> {
   }
 };
 
+template <typename A, A a, typename C>
+struct GridSampleBackwardBatchRuleHelper;
+
+template <typename F, F Func, typename T1, typename T2, typename T3, typename... T>
+struct GridSampleBackwardBatchRuleHelper<F, Func, typelist<T1, T2, T3, T...>> {
+  static std::tuple<Tensor, optional<int64_t>, Tensor, optional<int64_t>> apply(
+      const Tensor& grad_output, optional<int64_t> grad_output_batch_dim,
+      const Tensor& input, optional<int64_t> input_batch_dim,
+      const Tensor& grid, optional<int64_t> grid_batch_dim,
+      T... extra_args) {
+    return grid_sample_backward_batch_rule<F, Func, T...>(
+        grad_output, grad_output_batch_dim,
+        input, input_batch_dim,
+        grid, grid_batch_dim,
+        std::forward<T>(extra_args)...);
+  }
+};
+
+template <typename F, F Func>
+struct CudnnGridSampleBackwardBatchRuleHelper {
+  static std::tuple<Tensor, optional<int64_t>, Tensor, optional<int64_t>> apply(
+      const Tensor& input, optional<int64_t> input_batch_dim,
+      const Tensor& grid, optional<int64_t> grid_batch_dim,
+      const Tensor& grad_output, optional<int64_t> grad_output_batch_dim) {
+    return cudnn_grid_sample_backward_batch_rule<F, Func>(
+        input, input_batch_dim,
+        grid, grid_batch_dim,
+        grad_output, grad_output_batch_dim
+    );
+  }
+};
+
 #define GRID_SAMPLE_BATCH_RULE(fn) SINGLE_ARG(\
     GridSampleBatchRuleHelper<\
       decltype(&ATEN_FN(fn)),\
       &ATEN_FN(fn),\
       c10::guts::function_traits<decltype(ATEN_FN(fn))>::parameter_types>::apply)
 
+#define GRID_SAMPLE_BW_BATCH_RULE(fn) SINGLE_ARG(\
+    GridSampleBackwardBatchRuleHelper<\
+      decltype(&ATEN_FN(fn)),\
+      &ATEN_FN(fn),\
+      c10::guts::function_traits<decltype(ATEN_FN(fn))>::parameter_types>::apply)
+
+#define CUDNN_GRID_SAMPLE_BW_BATCH_RULE(fn)\
+    CudnnGridSampleBackwardBatchRuleHelper<decltype(&ATEN_FN(fn)), &ATEN_FN(fn)>::apply
+
 #define UPSAMPLE_BACKWARD(op, overload) VMAP_SUPPORT(#op"."#overload, SINGLE_ARG(\
     UpsampleBackwardBatchRuleHelper<\
       decltype(&ATEN_FN2(op, overload)),\
@@ -386,6 +507,7 @@ struct GridSampleBatchRuleHelper<F, Func, typelist<T1, T2, T...>> {
   EXISTING_BDIM2(op, vec); \
   EXISTING_BDIM(op);
 
+
 TORCH_LIBRARY_IMPL(aten, FT_BATCHED_KEY, m) {
   VMAP_SUPPORT("convolution", convolution_batch_rule);
   // m.impl("conv_transpose2d", convNd_transpose_decomp);
@@ -400,7 +522,12 @@ TORCH_LIBRARY_IMPL(aten, FT_BATCHED_KEY, m) {
   EXISTING_BDIM(im2col_backward);
 
   VMAP_SUPPORT("grid_sampler_2d", GRID_SAMPLE_BATCH_RULE(grid_sampler));
+  VMAP_SUPPORT("grid_sampler_2d_backward", GRID_SAMPLE_BW_BATCH_RULE(grid_sampler_2d_backward));
+
   VMAP_SUPPORT("grid_sampler_3d", GRID_SAMPLE_BATCH_RULE(grid_sampler));
+  VMAP_SUPPORT("grid_sampler_3d_backward", GRID_SAMPLE_BW_BATCH_RULE(grid_sampler_3d_backward));
+  VMAP_SUPPORT("cudnn_grid_sampler_backward", CUDNN_GRID_SAMPLE_BW_BATCH_RULE(cudnn_grid_sampler_backward));
+
   VMAP_SUPPORT("cudnn_grid_sampler", GRID_SAMPLE_BATCH_RULE(cudnn_grid_sampler));
   VMAP_SUPPORT("cross", cross_batch_rule);
 
diff --git a/functorch/csrc/BatchRulesScatterOps.cpp b/functorch/csrc/BatchRulesScatterOps.cpp
index 472d2519e..440c32026 100644
--- a/functorch/csrc/BatchRulesScatterOps.cpp
+++ b/functorch/csrc/BatchRulesScatterOps.cpp
@@ -158,34 +158,6 @@ Tensor& index_put__plumbing(Tensor & self, const List<optional<Tensor>> & indice
   return self;
 }
 
-int64_t bdim_size(
-    const Tensor& a, optional<int64_t> a_bdim,
-    const Tensor& b, optional<int64_t> b_bdim,
-    const Tensor& c, optional<int64_t> c_bdim) {
-  if (a_bdim) {
-    return a.size(*a_bdim);
-  }
-  if (b_bdim) {
-    return b.size(*b_bdim);
-  }
-  if (c_bdim) {
-    return c.size(*c_bdim);
-  }
-  TORCH_INTERNAL_ASSERT(false);
-}
-
-int64_t bdim_size(
-    const Tensor& a, optional<int64_t> a_bdim,
-    const Tensor& b, optional<int64_t> b_bdim) {
-  if (a_bdim) {
-    return a.size(*a_bdim);
-  }
-  if (b_bdim) {
-    return b.size(*b_bdim);
-  }
-  TORCH_INTERNAL_ASSERT(false);
-}
-
 namespace {
 
 template<typename Func, typename ...Args>
@@ -197,7 +169,7 @@ std::tuple<Tensor,optional<int64_t>> scatter_batch_rule(
     const Scalar& value, Args... args) {
   auto self_logical_rank = rankWithoutBatchDim(self, self_bdim);
   auto index_logical_rank = rankWithoutBatchDim(index, index_bdim);
-  auto batch_size = bdim_size(self, self_bdim, index, index_bdim);
+  auto batch_size = get_bdim_size2(self, self_bdim, index, index_bdim);
 
   auto self_ = moveBatchDimToFront(self, self_bdim);
   auto index_ = moveBatchDimToFront(index, index_bdim);
@@ -230,7 +202,7 @@ inline std::tuple<Tensor,optional<int64_t>> scatter_batch_rule(
   auto self_logical_rank = rankWithoutBatchDim(self, self_bdim);
   auto index_logical_rank = rankWithoutBatchDim(index, index_bdim);
   auto src_logical_rank = rankWithoutBatchDim(src, src_bdim);
-  auto batch_size = bdim_size(self, self_bdim, index, index_bdim, src, src_bdim);
+  auto batch_size = get_bdim_size3(self, self_bdim, index, index_bdim, src, src_bdim);
 
   auto self_ = moveBatchDimToFront(self, self_bdim);
   auto index_ = moveBatchDimToFront(index, index_bdim);
@@ -314,7 +286,7 @@ std::tuple<Tensor,optional<int64_t>> gather_batch_rule(
     bool sparse_grad) {
   auto self_logical_rank = rankWithoutBatchDim(self, self_bdim);
   auto index_logical_rank = rankWithoutBatchDim(index, index_bdim);
-  auto batch_size = bdim_size(self, self_bdim, index, index_bdim);
+  auto batch_size = get_bdim_size2(self, self_bdim, index, index_bdim);
 
   auto self_ = moveBatchDimToFront(self, self_bdim);
   auto index_ = moveBatchDimToFront(index, index_bdim);
@@ -343,7 +315,7 @@ std::tuple<Tensor,optional<int64_t>> gather_backward_batch_rule(
     int64_t dim,
     const Tensor& index, optional<int64_t> index_bdim,
     bool sparse_grad) {
-  auto batch_size = bdim_size(grad, grad_bdim, self, self_bdim, index, index_bdim);
+  auto batch_size = get_bdim_size3(grad, grad_bdim, self, self_bdim, index, index_bdim);
   auto grad_ = moveBatchDimToFront(grad, grad_bdim);
   auto self_ = moveBatchDimToFront(self, self_bdim);
   auto index_ = moveBatchDimToFront(index, index_bdim);
diff --git a/functorch/csrc/OutOfPlacePlumbing.cpp b/functorch/csrc/OutOfPlacePlumbing.cpp
index 0f91b4899..e9fe2f83a 100644
--- a/functorch/csrc/OutOfPlacePlumbing.cpp
+++ b/functorch/csrc/OutOfPlacePlumbing.cpp
@@ -438,7 +438,7 @@ Tensor lowerToNextLayer<batch_rule_22_t,Tensor,const Tensor &, const Scalar &, c
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
-// ['addmv', 'addr', 'baddbmm', 'sspaddmm', '_sparse_addmm', 'addmm', 'addbmm']
+// ['addmv', 'addr', 'baddbmm', 'sspaddmm', '_sparse_addmm', 'sparse_sampled_addmm', 'addmm', 'addbmm']
 typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_23_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &);
 template <>
 Tensor lowerToNextLayer<batch_rule_23_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &>(
@@ -683,11 +683,60 @@ std::tuple<Tensor,Tensor,Tensor,Tensor,int64_t> lowerToNextLayer<batch_rule_32_t
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level), makeBatched(std::get<6>(results), std::get<7>(results), cur_level), std::get<8>(results));
 }
 
-// ['bernoulli', '_standard_gamma', '_sample_dirichlet', 'poisson']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_33_t)(const Tensor &, c10::optional<int64_t>, c10::optional<Generator>);
+// ['_batch_norm_impl_index_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_33_t)(int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, ::std::array<bool,3>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_33_t,Tensor,const Tensor &, c10::optional<Generator>>(
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_33_t,std::tuple<Tensor,Tensor,Tensor>,int64_t, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, ::std::array<bool,3>, const Tensor &>(
   batch_rule_33_t batch_rule,
+  int64_t impl_index, const Tensor & input, const Tensor & grad_output, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, const c10::optional<Tensor> & save_mean, const c10::optional<Tensor> & save_var_transform, bool train, double eps, ::std::array<bool,3> output_mask, const Tensor & reservedSpace
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor reservedSpace_value;
+  optional<int64_t> reservedSpace_bdim;
+  std::tie(reservedSpace_value, reservedSpace_bdim) = unwrapTensorAtLevel(reservedSpace, cur_level);
+  optional<Tensor> weight_value;
+  optional<int64_t> weight_bdim;
+  if (weight) {
+      std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight.value(), cur_level);
+  }
+  optional<Tensor> running_mean_value;
+  optional<int64_t> running_mean_bdim;
+  if (running_mean) {
+      std::tie(running_mean_value, running_mean_bdim) = unwrapTensorAtLevel(running_mean.value(), cur_level);
+  }
+  optional<Tensor> running_var_value;
+  optional<int64_t> running_var_bdim;
+  if (running_var) {
+      std::tie(running_var_value, running_var_bdim) = unwrapTensorAtLevel(running_var.value(), cur_level);
+  }
+  optional<Tensor> save_mean_value;
+  optional<int64_t> save_mean_bdim;
+  if (save_mean) {
+      std::tie(save_mean_value, save_mean_bdim) = unwrapTensorAtLevel(save_mean.value(), cur_level);
+  }
+  optional<Tensor> save_var_transform_value;
+  optional<int64_t> save_var_transform_bdim;
+  if (save_var_transform) {
+      std::tie(save_var_transform_value, save_var_transform_bdim) = unwrapTensorAtLevel(save_var_transform.value(), cur_level);
+  }
+  auto results = batch_rule(impl_index, input_value, input_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, running_mean_value, running_mean_bdim, running_var_value, running_var_bdim, save_mean_value, save_mean_bdim, save_var_transform_value, save_var_transform_bdim, train, eps, output_mask, reservedSpace_value, reservedSpace_bdim);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
+// ['bernoulli', '_standard_gamma', '_sample_dirichlet', 'poisson']
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_34_t)(const Tensor &, c10::optional<int64_t>, c10::optional<Generator>);
+template <>
+Tensor lowerToNextLayer<batch_rule_34_t,Tensor,const Tensor &, c10::optional<Generator>>(
+  batch_rule_34_t batch_rule,
   const Tensor & self, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -702,10 +751,10 @@ Tensor lowerToNextLayer<batch_rule_33_t,Tensor,const Tensor &, c10::optional<Gen
 }
 
 // ['bernoulli.p', 'normal.Tensor_float']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_34_t)(const Tensor &, c10::optional<int64_t>, double, c10::optional<Generator>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_35_t)(const Tensor &, c10::optional<int64_t>, double, c10::optional<Generator>);
 template <>
-Tensor lowerToNextLayer<batch_rule_34_t,Tensor,const Tensor &, double, c10::optional<Generator>>(
-  batch_rule_34_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_35_t,Tensor,const Tensor &, double, c10::optional<Generator>>(
+  batch_rule_35_t batch_rule,
   const Tensor & self, double p, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -720,10 +769,10 @@ Tensor lowerToNextLayer<batch_rule_34_t,Tensor,const Tensor &, double, c10::opti
 }
 
 // ['bilinear']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_35_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_36_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_35_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &>(
-  batch_rule_35_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_36_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &>(
+  batch_rule_36_t batch_rule,
   const Tensor & input1, const Tensor & input2, const Tensor & weight, const c10::optional<Tensor> & bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -749,10 +798,10 @@ Tensor lowerToNextLayer<batch_rule_35_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['binary_cross_entropy']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_36_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_37_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_36_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_36_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_37_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_37_t batch_rule,
   const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -775,10 +824,10 @@ Tensor lowerToNextLayer<batch_rule_36_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['binary_cross_entropy_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_37_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_38_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_37_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_37_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_38_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_38_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -804,10 +853,10 @@ Tensor lowerToNextLayer<batch_rule_37_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['binary_cross_entropy_with_logits']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_38_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_39_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_38_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_38_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_39_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_39_t batch_rule,
   const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & pos_weight, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -835,10 +884,10 @@ Tensor lowerToNextLayer<batch_rule_38_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['binary_cross_entropy_with_logits_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_39_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_40_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_39_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_39_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_40_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_40_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & pos_weight, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -869,10 +918,10 @@ Tensor lowerToNextLayer<batch_rule_39_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['bincount']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_40_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_41_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_40_t,Tensor,const Tensor &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_40_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_41_t,Tensor,const Tensor &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_41_t batch_rule,
   const Tensor & self, const c10::optional<Tensor> & weights, int64_t minlength
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -892,10 +941,10 @@ Tensor lowerToNextLayer<batch_rule_40_t,Tensor,const Tensor &, const c10::option
 }
 
 // ['copysign.Scalar', 'clamp_max', 'clamp_min', 'div.Scalar', 'divide.Scalar', 'true_divide.Scalar', 'floor_divide.Scalar', 'xlogy.Scalar_Other', 'mul.Scalar', 'multiply.Scalar', 'hardshrink', 'celu', 'native_norm', 'norm.Scalar', 'bitwise_and.Scalar', '__and__.Scalar', 'bitwise_or.Scalar', '__or__.Scalar', 'bitwise_xor.Scalar', '__xor__.Scalar', '__lshift__.Scalar', 'bitwise_left_shift.Tensor_Scalar', '__rshift__.Scalar', 'bitwise_right_shift.Tensor_Scalar', 'ne.Scalar', 'not_equal.Scalar', 'eq.Scalar', 'ge.Scalar', 'greater_equal.Scalar', 'le.Scalar', 'less_equal.Scalar', 'gt.Scalar', 'greater.Scalar', 'lt.Scalar', 'less.Scalar', 'fmod.Scalar', 'remainder.Scalar', 'pow.Tensor_Scalar', 'float_power.Tensor_Scalar', 'leaky_relu', 'softshrink', 'special_xlog1py.other_scalar', 'special_xlogy.other_scalar', 'special_zeta.other_scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_41_t)(const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_42_t)(const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_41_t,Tensor,const Tensor &, const Scalar &>(
-  batch_rule_41_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_42_t,Tensor,const Tensor &, const Scalar &>(
+  batch_rule_42_t batch_rule,
   const Tensor & self, const Scalar & other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -910,10 +959,10 @@ Tensor lowerToNextLayer<batch_rule_41_t,Tensor,const Tensor &, const Scalar &>(
 }
 
 // ['unsafe_chunk', 'chunk', 'tensor_split.sections', 'unsafe_split.Tensor', 'split.Tensor']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_42_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_43_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_42_t,::std::vector<Tensor>,const Tensor &, int64_t, int64_t>(
-  batch_rule_42_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_43_t,::std::vector<Tensor>,const Tensor &, int64_t, int64_t>(
+  batch_rule_43_t batch_rule,
   const Tensor & self, int64_t chunks, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -928,10 +977,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_42_t,::std::vector<Tensor>,con
 }
 
 // ['tensor_split.indices', 'gradient.array', 'unsafe_split_with_sizes', 'split_with_sizes']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_43_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_44_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_43_t,::std::vector<Tensor>,const Tensor &, IntArrayRef, int64_t>(
-  batch_rule_43_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_44_t,::std::vector<Tensor>,const Tensor &, IntArrayRef, int64_t>(
+  batch_rule_44_t batch_rule,
   const Tensor & self, IntArrayRef indices, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -946,10 +995,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_43_t,::std::vector<Tensor>,con
 }
 
 // ['tensor_split.tensor_indices_or_sections']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_44_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_45_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_44_t,::std::vector<Tensor>,const Tensor &, const Tensor &, int64_t>(
-  batch_rule_44_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_45_t,::std::vector<Tensor>,const Tensor &, const Tensor &, int64_t>(
+  batch_rule_45_t batch_rule,
   const Tensor & self, const Tensor & tensor_indices_or_sections, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -967,10 +1016,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_44_t,::std::vector<Tensor>,con
 }
 
 // ['clamp', 'clip']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_45_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, const c10::optional<Scalar> &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_46_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, const c10::optional<Scalar> &);
 template <>
-Tensor lowerToNextLayer<batch_rule_45_t,Tensor,const Tensor &, const c10::optional<Scalar> &, const c10::optional<Scalar> &>(
-  batch_rule_45_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_46_t,Tensor,const Tensor &, const c10::optional<Scalar> &, const c10::optional<Scalar> &>(
+  batch_rule_46_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & min, const c10::optional<Scalar> & max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -985,10 +1034,10 @@ Tensor lowerToNextLayer<batch_rule_45_t,Tensor,const Tensor &, const c10::option
 }
 
 // ['clamp.Tensor', 'clip.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_46_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_47_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_46_t,Tensor,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_46_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_47_t,Tensor,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_47_t batch_rule,
   const Tensor & self, const c10::optional<Tensor> & min, const c10::optional<Tensor> & max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1013,10 +1062,10 @@ Tensor lowerToNextLayer<batch_rule_46_t,Tensor,const Tensor &, const c10::option
 }
 
 // ['constant_pad_nd']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_47_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_48_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_47_t,Tensor,const Tensor &, IntArrayRef, const Scalar &>(
-  batch_rule_47_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_48_t,Tensor,const Tensor &, IntArrayRef, const Scalar &>(
+  batch_rule_48_t batch_rule,
   const Tensor & self, IntArrayRef pad, const Scalar & value
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1031,10 +1080,10 @@ Tensor lowerToNextLayer<batch_rule_47_t,Tensor,const Tensor &, IntArrayRef, cons
 }
 
 // ['contiguous']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_48_t)(const Tensor &, c10::optional<int64_t>, MemoryFormat);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_49_t)(const Tensor &, c10::optional<int64_t>, MemoryFormat);
 template <>
-Tensor lowerToNextLayer<batch_rule_48_t,Tensor,const Tensor &, MemoryFormat>(
-  batch_rule_48_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_49_t,Tensor,const Tensor &, MemoryFormat>(
+  batch_rule_49_t batch_rule,
   const Tensor & self, MemoryFormat memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1049,10 +1098,10 @@ Tensor lowerToNextLayer<batch_rule_48_t,Tensor,const Tensor &, MemoryFormat>(
 }
 
 // ['convolution', 'convolution_overrideable']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_49_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_50_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_49_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t>(
-  batch_rule_49_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_50_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t>(
+  batch_rule_50_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1074,11 +1123,35 @@ Tensor lowerToNextLayer<batch_rule_49_t,Tensor,const Tensor &, const Tensor &, c
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['convolution_backward_overrideable']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_51_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_51_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, ::std::array<bool,3>>(
+  batch_rule_51_t batch_rule,
+  const Tensor & grad_output, const Tensor & input, const Tensor & weight, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, input_value, input_bdim, weight_value, weight_bdim, stride, padding, dilation, transposed, output_padding, groups, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['_convolution']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_50_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_52_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_50_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool, bool>(
-  batch_rule_50_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_52_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool, bool>(
+  batch_rule_52_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups, bool benchmark, bool deterministic, bool cudnn_enabled, bool allow_tf32
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1101,10 +1174,10 @@ Tensor lowerToNextLayer<batch_rule_50_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['_convolution.deprecated']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_51_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_53_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_51_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool>(
-  batch_rule_51_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_53_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool>(
+  batch_rule_53_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups, bool benchmark, bool deterministic, bool cudnn_enabled
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1127,10 +1200,10 @@ Tensor lowerToNextLayer<batch_rule_51_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['_convolution_mode', 'conv1d.padding', 'conv2d.padding', 'conv3d.padding']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_52_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, c10::string_view, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_54_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, c10::string_view, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_52_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, c10::string_view, IntArrayRef, int64_t>(
-  batch_rule_52_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_54_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, c10::string_view, IntArrayRef, int64_t>(
+  batch_rule_54_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, c10::string_view padding, IntArrayRef dilation, int64_t groups
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1153,10 +1226,10 @@ Tensor lowerToNextLayer<batch_rule_52_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['_convolution_nogroup']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_53_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_55_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_53_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef>(
-  batch_rule_53_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_55_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef>(
+  batch_rule_55_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1178,11 +1251,50 @@ Tensor lowerToNextLayer<batch_rule_53_t,Tensor,const Tensor &, const Tensor &, c
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['_convolution_double_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_56_t)(const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool, bool, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_56_t,std::tuple<Tensor,Tensor,Tensor>,const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, bool, IntArrayRef, int64_t, bool, bool, bool, bool, ::std::array<bool,3>>(
+  batch_rule_56_t batch_rule,
+  const c10::optional<Tensor> & ggI, const c10::optional<Tensor> & ggW, const c10::optional<Tensor> & ggb, const Tensor & gO, const Tensor & weight, const Tensor & self, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool transposed, IntArrayRef output_padding, int64_t groups, bool benchmark, bool deterministic, bool cudnn_enabled, bool allow_tf32, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor gO_value;
+  optional<int64_t> gO_bdim;
+  std::tie(gO_value, gO_bdim) = unwrapTensorAtLevel(gO, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  optional<Tensor> ggI_value;
+  optional<int64_t> ggI_bdim;
+  if (ggI) {
+      std::tie(ggI_value, ggI_bdim) = unwrapTensorAtLevel(ggI.value(), cur_level);
+  }
+  optional<Tensor> ggW_value;
+  optional<int64_t> ggW_bdim;
+  if (ggW) {
+      std::tie(ggW_value, ggW_bdim) = unwrapTensorAtLevel(ggW.value(), cur_level);
+  }
+  optional<Tensor> ggb_value;
+  optional<int64_t> ggb_bdim;
+  if (ggb) {
+      std::tie(ggb_value, ggb_bdim) = unwrapTensorAtLevel(ggb.value(), cur_level);
+  }
+  auto results = batch_rule(ggI_value, ggI_bdim, ggW_value, ggW_bdim, ggb_value, ggb_bdim, gO_value, gO_bdim, weight_value, weight_bdim, self_value, self_bdim, stride, padding, dilation, transposed, output_padding, groups, benchmark, deterministic, cudnn_enabled, allow_tf32, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['conv1d', 'conv2d', 'conv3d', 'cudnn_convolution_relu', 'mkldnn_convolution']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_54_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_57_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_54_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
-  batch_rule_54_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_57_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
+  batch_rule_57_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, int64_t groups
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1205,10 +1317,10 @@ Tensor lowerToNextLayer<batch_rule_54_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['conv_tbc', 'cummaxmin_backward', '_make_per_channel_quantized_tensor', 'mse_loss_backward', 'l1_loss_backward', 'soft_margin_loss_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_55_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_58_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_55_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t>(
-  batch_rule_55_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_58_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t>(
+  batch_rule_58_t batch_rule,
   const Tensor & self, const Tensor & weight, const Tensor & bias, int64_t pad
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1229,10 +1341,10 @@ Tensor lowerToNextLayer<batch_rule_55_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['conv_tbc_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_56_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_59_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_56_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t>(
-  batch_rule_56_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_59_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t>(
+  batch_rule_59_t batch_rule,
   const Tensor & self, const Tensor & input, const Tensor & weight, const Tensor & bias, int64_t pad
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1256,10 +1368,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_56_t,std::tuple<Ten
 }
 
 // ['conv_transpose1d', 'conv_transpose2d.input', 'conv_transpose3d.input']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_57_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_60_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_57_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, IntArrayRef>(
-  batch_rule_57_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_60_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, IntArrayRef>(
+  batch_rule_60_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, int64_t groups, IntArrayRef dilation
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1282,10 +1394,10 @@ Tensor lowerToNextLayer<batch_rule_57_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['_copy_from', 'cholesky_solve', '_cholesky_solve_helper', '_convert_indices_from_csr_to_coo', 'linalg_pinv.rcond_tensor', 'linalg_matrix_rank.tol_tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_58_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_61_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_58_t,Tensor,const Tensor &, const Tensor &, bool>(
-  batch_rule_58_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_61_t,Tensor,const Tensor &, const Tensor &, bool>(
+  batch_rule_61_t batch_rule,
   const Tensor & self, const Tensor & dst, bool non_blocking
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1303,10 +1415,10 @@ Tensor lowerToNextLayer<batch_rule_58_t,Tensor,const Tensor &, const Tensor &, b
 }
 
 // ['cosine_embedding_loss', 'margin_ranking_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_59_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_62_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_59_t,Tensor,const Tensor &, const Tensor &, const Tensor &, double, int64_t>(
-  batch_rule_59_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_62_t,Tensor,const Tensor &, const Tensor &, const Tensor &, double, int64_t>(
+  batch_rule_62_t batch_rule,
   const Tensor & input1, const Tensor & input2, const Tensor & target, double margin, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1327,10 +1439,10 @@ Tensor lowerToNextLayer<batch_rule_59_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['count_nonzero', 'repeat_interleave.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_60_t)(const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_63_t)(const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_60_t,Tensor,const Tensor &, c10::optional<int64_t>>(
-  batch_rule_60_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_63_t,Tensor,const Tensor &, c10::optional<int64_t>>(
+  batch_rule_63_t batch_rule,
   const Tensor & self, c10::optional<int64_t> dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1345,10 +1457,10 @@ Tensor lowerToNextLayer<batch_rule_60_t,Tensor,const Tensor &, c10::optional<int
 }
 
 // ['cov']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_61_t)(const Tensor &, c10::optional<int64_t>, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_64_t)(const Tensor &, c10::optional<int64_t>, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_61_t,Tensor,const Tensor &, int64_t, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_61_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_64_t,Tensor,const Tensor &, int64_t, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_64_t batch_rule,
   const Tensor & self, int64_t correction, const c10::optional<Tensor> & fweights, const c10::optional<Tensor> & aweights
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1373,10 +1485,10 @@ Tensor lowerToNextLayer<batch_rule_61_t,Tensor,const Tensor &, int64_t, const c1
 }
 
 // ['cudnn_affine_grid_generator', 'cudnn_affine_grid_generator_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_62_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_65_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_62_t,Tensor,const Tensor &, int64_t, int64_t, int64_t, int64_t>(
-  batch_rule_62_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_65_t,Tensor,const Tensor &, int64_t, int64_t, int64_t, int64_t>(
+  batch_rule_65_t batch_rule,
   const Tensor & theta, int64_t N, int64_t C, int64_t H, int64_t W
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1391,10 +1503,10 @@ Tensor lowerToNextLayer<batch_rule_62_t,Tensor,const Tensor &, int64_t, int64_t,
 }
 
 // ['cudnn_batch_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_63_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_66_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_63_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, double>(
-  batch_rule_63_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_66_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, double>(
+  batch_rule_66_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, bool training, double exponential_average_factor, double epsilon
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1427,10 +1539,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_63_t,std::tu
 }
 
 // ['cudnn_batch_norm_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_64_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_67_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_64_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, const Tensor &>(
-  batch_rule_64_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_67_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, const Tensor &>(
+  batch_rule_67_t batch_rule,
   const Tensor & input, const Tensor & grad_output, const Tensor & weight, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, const c10::optional<Tensor> & save_mean, const c10::optional<Tensor> & save_var, double epsilon, const Tensor & reserveSpace
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1474,10 +1586,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_64_t,std::tuple<Ten
 }
 
 // ['cudnn_convolution.deprecated', 'miopen_convolution', 'miopen_depthwise_convolution']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_65_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_68_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_65_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
-  batch_rule_65_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_68_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
+  batch_rule_68_t batch_rule,
   const Tensor & self, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1500,10 +1612,10 @@ Tensor lowerToNextLayer<batch_rule_65_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['cudnn_convolution.deprecated2', 'miopen_convolution_transpose_backward_input']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_66_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_69_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_66_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
-  batch_rule_66_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_69_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
+  batch_rule_69_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1521,10 +1633,10 @@ Tensor lowerToNextLayer<batch_rule_66_t,Tensor,const Tensor &, const Tensor &, I
 }
 
 // ['cudnn_convolution', 'cudnn_convolution_transpose_backward_input']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_67_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_70_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_67_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool>(
-  batch_rule_67_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_70_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool>(
+  batch_rule_70_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1542,10 +1654,10 @@ Tensor lowerToNextLayer<batch_rule_67_t,Tensor,const Tensor &, const Tensor &, I
 }
 
 // ['cudnn_convolution_backward_input', 'cudnn_convolution_backward_weight', 'cudnn_convolution_transpose_backward_weight']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_68_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_71_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_68_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool>(
-  batch_rule_68_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_71_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool>(
+  batch_rule_71_t batch_rule,
   IntArrayRef self_size, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1562,11 +1674,35 @@ Tensor lowerToNextLayer<batch_rule_68_t,Tensor,IntArrayRef, const Tensor &, cons
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['cudnn_convolution_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_72_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool, ::std::array<bool,2>);
+template <>
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_72_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool, ::std::array<bool,2>>(
+  batch_rule_72_t batch_rule,
+  const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32, ::std::array<bool,2> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(self_value, self_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, padding, stride, dilation, groups, benchmark, deterministic, allow_tf32, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
+}
+
 // ['cudnn_convolution_transpose.deprecated', 'miopen_convolution_transpose']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_69_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_73_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_69_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
-  batch_rule_69_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_73_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
+  batch_rule_73_t batch_rule,
   const Tensor & self, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1589,10 +1725,10 @@ Tensor lowerToNextLayer<batch_rule_69_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['cudnn_convolution_transpose.deprecated2']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_70_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_74_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_70_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
-  batch_rule_70_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_74_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
+  batch_rule_74_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1610,10 +1746,10 @@ Tensor lowerToNextLayer<batch_rule_70_t,Tensor,const Tensor &, const Tensor &, I
 }
 
 // ['cudnn_convolution_transpose']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_71_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_75_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_71_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool>(
-  batch_rule_71_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_75_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool>(
+  batch_rule_75_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1630,11 +1766,35 @@ Tensor lowerToNextLayer<batch_rule_71_t,Tensor,const Tensor &, const Tensor &, I
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['cudnn_convolution_transpose_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_76_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool, ::std::array<bool,2>);
+template <>
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_76_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, bool, ::std::array<bool,2>>(
+  batch_rule_76_t batch_rule,
+  const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32, ::std::array<bool,2> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(self_value, self_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, padding, output_padding, stride, dilation, groups, benchmark, deterministic, allow_tf32, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
+}
+
 // ['cudnn_convolution_add_relu']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_72_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_77_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_72_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Scalar> &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
-  batch_rule_72_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_77_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Scalar> &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
+  batch_rule_77_t batch_rule,
   const Tensor & self, const Tensor & weight, const Tensor & z, const c10::optional<Scalar> & alpha, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, int64_t groups
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1660,10 +1820,10 @@ Tensor lowerToNextLayer<batch_rule_72_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['cudnn_grid_sampler_backward', 'prelu_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_73_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_78_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_73_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &>(
-  batch_rule_73_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_78_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &>(
+  batch_rule_78_t batch_rule,
   const Tensor & self, const Tensor & grid, const Tensor & grad_output
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1684,10 +1844,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_73_t,std::tuple<Tensor,Ten
 }
 
 // ['cummax.dimname', 'cummin.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_74_t)(const Tensor &, c10::optional<int64_t>, Dimname);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_79_t)(const Tensor &, c10::optional<int64_t>, Dimname);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_74_t,std::tuple<Tensor,Tensor>,const Tensor &, Dimname>(
-  batch_rule_74_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_79_t,std::tuple<Tensor,Tensor>,const Tensor &, Dimname>(
+  batch_rule_79_t batch_rule,
   const Tensor & self, Dimname dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1702,10 +1862,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_74_t,std::tuple<Tensor,Ten
 }
 
 // ['cumprod', 'cumsum', 'log_softmax.int', 'softmax.int', '_sparse_softmax.int', '_sparse_log_softmax.int', 'special_log_softmax', 'special_softmax']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_75_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_80_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_75_t,Tensor,const Tensor &, int64_t, c10::optional<ScalarType>>(
-  batch_rule_75_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_80_t,Tensor,const Tensor &, int64_t, c10::optional<ScalarType>>(
+  batch_rule_80_t batch_rule,
   const Tensor & self, int64_t dim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1720,10 +1880,10 @@ Tensor lowerToNextLayer<batch_rule_75_t,Tensor,const Tensor &, int64_t, c10::opt
 }
 
 // ['cumprod.dimname', 'cumsum.dimname', 'log_softmax.Dimname', 'softmax.Dimname', '_sparse_softmax.Dimname', '_sparse_log_softmax.Dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_76_t)(const Tensor &, c10::optional<int64_t>, Dimname, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_81_t)(const Tensor &, c10::optional<int64_t>, Dimname, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_76_t,Tensor,const Tensor &, Dimname, c10::optional<ScalarType>>(
-  batch_rule_76_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_81_t,Tensor,const Tensor &, Dimname, c10::optional<ScalarType>>(
+  batch_rule_81_t batch_rule,
   const Tensor & self, Dimname dim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1738,10 +1898,10 @@ Tensor lowerToNextLayer<batch_rule_76_t,Tensor,const Tensor &, Dimname, c10::opt
 }
 
 // ['cumprod_backward', '_sparse_softmax_backward_data', '_sparse_log_softmax_backward_data']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_77_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_82_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_77_t,Tensor,const Tensor &, const Tensor &, int64_t, const Tensor &>(
-  batch_rule_77_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_82_t,Tensor,const Tensor &, const Tensor &, int64_t, const Tensor &>(
+  batch_rule_82_t batch_rule,
   const Tensor & grad, const Tensor & input, int64_t dim, const Tensor & output
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1762,10 +1922,10 @@ Tensor lowerToNextLayer<batch_rule_77_t,Tensor,const Tensor &, const Tensor &, i
 }
 
 // ['cumulative_trapezoid.dx', 'trapezoid.dx']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_78_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_83_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_78_t,Tensor,const Tensor &, const Scalar &, int64_t>(
-  batch_rule_78_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_83_t,Tensor,const Tensor &, const Scalar &, int64_t>(
+  batch_rule_83_t batch_rule,
   const Tensor & y, const Scalar & dx, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1780,10 +1940,10 @@ Tensor lowerToNextLayer<batch_rule_78_t,Tensor,const Tensor &, const Scalar &, i
 }
 
 // ['ctc_loss.IntList']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_79_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, int64_t, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_84_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, int64_t, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_79_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, int64_t, int64_t, bool>(
-  batch_rule_79_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_84_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, int64_t, int64_t, bool>(
+  batch_rule_84_t batch_rule,
   const Tensor & log_probs, const Tensor & targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank, int64_t reduction, bool zero_infinity
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1801,10 +1961,10 @@ Tensor lowerToNextLayer<batch_rule_79_t,Tensor,const Tensor &, const Tensor &, I
 }
 
 // ['ctc_loss.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_80_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_85_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_80_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, bool>(
-  batch_rule_80_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_85_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, bool>(
+  batch_rule_85_t batch_rule,
   const Tensor & log_probs, const Tensor & targets, const Tensor & input_lengths, const Tensor & target_lengths, int64_t blank, int64_t reduction, bool zero_infinity
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1828,10 +1988,10 @@ Tensor lowerToNextLayer<batch_rule_80_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['_ctc_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_81_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_86_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, int64_t, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_81_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, int64_t, bool>(
-  batch_rule_81_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_86_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, int64_t, bool>(
+  batch_rule_86_t batch_rule,
   const Tensor & log_probs, const Tensor & targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank, bool zero_infinity
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1849,10 +2009,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_81_t,std::tuple<Tensor,Ten
 }
 
 // ['_ctc_loss_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_82_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_87_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_82_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, const Tensor &, const Tensor &, int64_t, bool>(
-  batch_rule_82_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_87_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, const Tensor &, const Tensor &, int64_t, bool>(
+  batch_rule_87_t batch_rule,
   const Tensor & grad, const Tensor & log_probs, const Tensor & targets, IntArrayRef input_lengths, IntArrayRef target_lengths, const Tensor & neg_log_likelihood, const Tensor & log_alpha, int64_t blank, bool zero_infinity
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1879,10 +2039,10 @@ Tensor lowerToNextLayer<batch_rule_82_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['diag_embed', 'diagonal', 'narrow_copy', 'narrow', 'unfold', '_remove_batch_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_83_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_88_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_83_t,Tensor,const Tensor &, int64_t, int64_t, int64_t>(
-  batch_rule_83_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_88_t,Tensor,const Tensor &, int64_t, int64_t, int64_t>(
+  batch_rule_88_t batch_rule,
   const Tensor & self, int64_t offset, int64_t dim1, int64_t dim2
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1897,10 +2057,10 @@ Tensor lowerToNextLayer<batch_rule_83_t,Tensor,const Tensor &, int64_t, int64_t,
 }
 
 // ['diagonal.Dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_84_t)(const Tensor &, c10::optional<int64_t>, Dimname, Dimname, Dimname, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_89_t)(const Tensor &, c10::optional<int64_t>, Dimname, Dimname, Dimname, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_84_t,Tensor,const Tensor &, Dimname, Dimname, Dimname, int64_t>(
-  batch_rule_84_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_89_t,Tensor,const Tensor &, Dimname, Dimname, Dimname, int64_t>(
+  batch_rule_89_t batch_rule,
   const Tensor & self, Dimname outdim, Dimname dim1, Dimname dim2, int64_t offset
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1915,10 +2075,10 @@ Tensor lowerToNextLayer<batch_rule_84_t,Tensor,const Tensor &, Dimname, Dimname,
 }
 
 // ['diagonal_backward', 'unfold_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_85_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_90_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_85_t,Tensor,const Tensor &, IntArrayRef, int64_t, int64_t, int64_t>(
-  batch_rule_85_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_90_t,Tensor,const Tensor &, IntArrayRef, int64_t, int64_t, int64_t>(
+  batch_rule_90_t batch_rule,
   const Tensor & grad_output, IntArrayRef input_sizes, int64_t offset, int64_t dim1, int64_t dim2
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1933,10 +2093,10 @@ Tensor lowerToNextLayer<batch_rule_85_t,Tensor,const Tensor &, IntArrayRef, int6
 }
 
 // ['diff']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_86_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_91_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_86_t,Tensor,const Tensor &, int64_t, int64_t, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_86_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_91_t,Tensor,const Tensor &, int64_t, int64_t, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_91_t batch_rule,
   const Tensor & self, int64_t n, int64_t dim, const c10::optional<Tensor> & prepend, const c10::optional<Tensor> & append
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1961,10 +2121,10 @@ Tensor lowerToNextLayer<batch_rule_86_t,Tensor,const Tensor &, int64_t, int64_t,
 }
 
 // ['gradient.scalarint']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_87_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_92_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, c10::optional<int64_t>, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_87_t,::std::vector<Tensor>,const Tensor &, const c10::optional<Scalar> &, c10::optional<int64_t>, int64_t>(
-  batch_rule_87_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_92_t,::std::vector<Tensor>,const Tensor &, const c10::optional<Scalar> &, c10::optional<int64_t>, int64_t>(
+  batch_rule_92_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & spacing, c10::optional<int64_t> dim, int64_t edge_order
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1979,10 +2139,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_87_t,::std::vector<Tensor>,con
 }
 
 // ['gradient.scalararray']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_88_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, IntArrayRef, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_93_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, IntArrayRef, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_88_t,::std::vector<Tensor>,const Tensor &, const Scalar &, IntArrayRef, int64_t>(
-  batch_rule_88_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_93_t,::std::vector<Tensor>,const Tensor &, const Scalar &, IntArrayRef, int64_t>(
+  batch_rule_93_t batch_rule,
   const Tensor & self, const Scalar & spacing, IntArrayRef dim, int64_t edge_order
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -1997,10 +2157,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_88_t,::std::vector<Tensor>,con
 }
 
 // ['gradient.scalarrayint']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_89_t)(const Tensor &, c10::optional<int64_t>, ArrayRef<Scalar>, c10::optional<int64_t>, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_94_t)(const Tensor &, c10::optional<int64_t>, ArrayRef<Scalar>, c10::optional<int64_t>, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_89_t,::std::vector<Tensor>,const Tensor &, ArrayRef<Scalar>, c10::optional<int64_t>, int64_t>(
-  batch_rule_89_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_94_t,::std::vector<Tensor>,const Tensor &, ArrayRef<Scalar>, c10::optional<int64_t>, int64_t>(
+  batch_rule_94_t batch_rule,
   const Tensor & self, ArrayRef<Scalar> spacing, c10::optional<int64_t> dim, int64_t edge_order
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2015,10 +2175,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_89_t,::std::vector<Tensor>,con
 }
 
 // ['gradient.scalarrayarray']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_90_t)(const Tensor &, c10::optional<int64_t>, ArrayRef<Scalar>, IntArrayRef, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_95_t)(const Tensor &, c10::optional<int64_t>, ArrayRef<Scalar>, IntArrayRef, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_90_t,::std::vector<Tensor>,const Tensor &, ArrayRef<Scalar>, IntArrayRef, int64_t>(
-  batch_rule_90_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_95_t,::std::vector<Tensor>,const Tensor &, ArrayRef<Scalar>, IntArrayRef, int64_t>(
+  batch_rule_95_t batch_rule,
   const Tensor & self, ArrayRef<Scalar> spacing, IntArrayRef dim, int64_t edge_order
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2033,10 +2193,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_90_t,::std::vector<Tensor>,con
 }
 
 // ['div.Tensor_mode', 'divide.Tensor_mode']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_91_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<c10::string_view>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_96_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<c10::string_view>);
 template <>
-Tensor lowerToNextLayer<batch_rule_91_t,Tensor,const Tensor &, const Tensor &, c10::optional<c10::string_view>>(
-  batch_rule_91_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_96_t,Tensor,const Tensor &, const Tensor &, c10::optional<c10::string_view>>(
+  batch_rule_96_t batch_rule,
   const Tensor & self, const Tensor & other, c10::optional<c10::string_view> rounding_mode
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2054,10 +2214,10 @@ Tensor lowerToNextLayer<batch_rule_91_t,Tensor,const Tensor &, const Tensor &, c
 }
 
 // ['div.Scalar_mode', 'divide.Scalar_mode']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_92_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, c10::optional<c10::string_view>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_97_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, c10::optional<c10::string_view>);
 template <>
-Tensor lowerToNextLayer<batch_rule_92_t,Tensor,const Tensor &, const Scalar &, c10::optional<c10::string_view>>(
-  batch_rule_92_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_97_t,Tensor,const Tensor &, const Scalar &, c10::optional<c10::string_view>>(
+  batch_rule_97_t batch_rule,
   const Tensor & self, const Scalar & other, c10::optional<c10::string_view> rounding_mode
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2072,10 +2232,10 @@ Tensor lowerToNextLayer<batch_rule_92_t,Tensor,const Tensor &, const Scalar &, c
 }
 
 // ['embedding']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_93_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_98_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_93_t,Tensor,const Tensor &, const Tensor &, int64_t, bool, bool>(
-  batch_rule_93_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_98_t,Tensor,const Tensor &, const Tensor &, int64_t, bool, bool>(
+  batch_rule_98_t batch_rule,
   const Tensor & weight, const Tensor & indices, int64_t padding_idx, bool scale_grad_by_freq, bool sparse
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2093,10 +2253,10 @@ Tensor lowerToNextLayer<batch_rule_93_t,Tensor,const Tensor &, const Tensor &, i
 }
 
 // ['embedding_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_94_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_99_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_94_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t, bool, bool>(
-  batch_rule_94_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_99_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t, bool, bool>(
+  batch_rule_99_t batch_rule,
   const Tensor & grad, const Tensor & indices, int64_t num_weights, int64_t padding_idx, bool scale_grad_by_freq, bool sparse
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2114,10 +2274,10 @@ Tensor lowerToNextLayer<batch_rule_94_t,Tensor,const Tensor &, const Tensor &, i
 }
 
 // ['embedding_dense_backward', 'embedding_sparse_backward', 'grid_sampler', 'grid_sampler_2d', '_grid_sampler_2d_cpu_fallback', 'grid_sampler_3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_95_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_100_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_95_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t, bool>(
-  batch_rule_95_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_100_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t, bool>(
+  batch_rule_100_t batch_rule,
   const Tensor & grad_output, const Tensor & indices, int64_t num_weights, int64_t padding_idx, bool scale_grad_by_freq
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2135,10 +2295,10 @@ Tensor lowerToNextLayer<batch_rule_95_t,Tensor,const Tensor &, const Tensor &, i
 }
 
 // ['_embedding_bag_forward_only', '_embedding_bag']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_96_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_101_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, int64_t);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_96_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool, int64_t, bool, const c10::optional<Tensor> &, bool, int64_t>(
-  batch_rule_96_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_101_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool, int64_t, bool, const c10::optional<Tensor> &, bool, int64_t>(
+  batch_rule_101_t batch_rule,
   const Tensor & weight, const Tensor & indices, const Tensor & offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional<Tensor> & per_sample_weights, bool include_last_offset, int64_t padding_idx
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2164,10 +2324,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_96_t,std::tu
 }
 
 // ['_rowwise_prune']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_97_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_102_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ScalarType);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_97_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, ScalarType>(
-  batch_rule_97_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_102_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, ScalarType>(
+  batch_rule_102_t batch_rule,
   const Tensor & weight, const Tensor & mask, ScalarType compressed_indices_dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2185,10 +2345,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_97_t,std::tuple<Tensor,Ten
 }
 
 // ['embedding_bag']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_98_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_103_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_98_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool, int64_t, bool, const c10::optional<Tensor> &, bool>(
-  batch_rule_98_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_103_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool, int64_t, bool, const c10::optional<Tensor> &, bool>(
+  batch_rule_103_t batch_rule,
   const Tensor & weight, const Tensor & indices, const Tensor & offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional<Tensor> & per_sample_weights, bool include_last_offset
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2214,10 +2374,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_98_t,std::tu
 }
 
 // ['embedding_bag.padding_idx']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_99_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_104_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_99_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool, int64_t, bool, const c10::optional<Tensor> &, bool, c10::optional<int64_t>>(
-  batch_rule_99_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_104_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool, int64_t, bool, const c10::optional<Tensor> &, bool, c10::optional<int64_t>>(
+  batch_rule_104_t batch_rule,
   const Tensor & weight, const Tensor & indices, const Tensor & offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional<Tensor> & per_sample_weights, bool include_last_offset, c10::optional<int64_t> padding_idx
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2243,10 +2403,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_99_t,std::tu
 }
 
 // ['_embedding_bag_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_100_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_105_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool, int64_t, bool, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_100_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, bool, int64_t, bool, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_100_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_105_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, bool, int64_t, bool, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_105_t batch_rule,
   const Tensor & grad, const Tensor & indices, const Tensor & offsets, const Tensor & offset2bag, const Tensor & bag_size, const Tensor & maximum_indices, int64_t num_weights, bool scale_grad_by_freq, int64_t mode, bool sparse, const c10::optional<Tensor> & per_sample_weights, int64_t padding_idx
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2281,10 +2441,10 @@ Tensor lowerToNextLayer<batch_rule_100_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_embedding_bag_sparse_backward', '_embedding_bag_dense_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_101_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_106_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_101_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, bool, int64_t, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_101_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_106_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, bool, int64_t, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_106_t batch_rule,
   const Tensor & grad, const Tensor & indices, const Tensor & offsets, const Tensor & offset2bag, const Tensor & bag_size, int64_t num_weights, bool scale_grad_by_freq, int64_t mode, const c10::optional<Tensor> & per_sample_weights, int64_t padding_idx
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2316,10 +2476,10 @@ Tensor lowerToNextLayer<batch_rule_101_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_embedding_bag_per_sample_weights_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_102_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_107_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_102_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t>(
-  batch_rule_102_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_107_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t>(
+  batch_rule_107_t batch_rule,
   const Tensor & grad, const Tensor & weight, const Tensor & indices, const Tensor & offsets, const Tensor & offset2bag, int64_t mode, int64_t padding_idx
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2346,10 +2506,10 @@ Tensor lowerToNextLayer<batch_rule_102_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['new_empty', 'new_zeros', 'new_ones']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_103_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_108_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_103_t,Tensor,const Tensor &, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_103_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_108_t,Tensor,const Tensor &, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_108_t batch_rule,
   const Tensor & self, IntArrayRef size, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2364,10 +2524,10 @@ Tensor lowerToNextLayer<batch_rule_103_t,Tensor,const Tensor &, IntArrayRef, c10
 }
 
 // ['new_empty_strided']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_104_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_109_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_104_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_104_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_109_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_109_t batch_rule,
   const Tensor & self, IntArrayRef size, IntArrayRef stride, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2382,10 +2542,10 @@ Tensor lowerToNextLayer<batch_rule_104_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['new_full']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_105_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_110_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_105_t,Tensor,const Tensor &, IntArrayRef, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_105_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_110_t,Tensor,const Tensor &, IntArrayRef, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_110_t batch_rule,
   const Tensor & self, IntArrayRef size, const Scalar & fill_value, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2400,10 +2560,10 @@ Tensor lowerToNextLayer<batch_rule_105_t,Tensor,const Tensor &, IntArrayRef, con
 }
 
 // ['_empty_per_channel_affine_quantized']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_106_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_111_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_106_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
-  batch_rule_106_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_111_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
+  batch_rule_111_t batch_rule,
   IntArrayRef size, const Tensor & scales, const Tensor & zero_points, int64_t axis, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2421,10 +2581,10 @@ Tensor lowerToNextLayer<batch_rule_106_t,Tensor,IntArrayRef, const Tensor &, con
 }
 
 // ['empty_quantized']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_107_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_112_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_107_t,Tensor,IntArrayRef, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
-  batch_rule_107_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_112_t,Tensor,IntArrayRef, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
+  batch_rule_112_t batch_rule,
   IntArrayRef size, const Tensor & qtensor, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2439,10 +2599,10 @@ Tensor lowerToNextLayer<batch_rule_107_t,Tensor,IntArrayRef, const Tensor &, c10
 }
 
 // ['empty_like', 'ones_like', 'rand_like', 'randn_like', 'zeros_like']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_108_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_113_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_108_t,Tensor,const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
-  batch_rule_108_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_113_t,Tensor,const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
+  batch_rule_113_t batch_rule,
   const Tensor & self, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2457,10 +2617,10 @@ Tensor lowerToNextLayer<batch_rule_108_t,Tensor,const Tensor &, c10::optional<Sc
 }
 
 // ['flatten.using_ints', 'fbgemm_pack_quantized_matrix.KN', 'movedim.int', 'moveaxis.int', 'select.int', 'transpose.int', '_mkldnn_transpose', 'norm_except_dim', 'swapaxes', 'swapdims', '_add_batch_dim', '_test_ambiguous_defaults.a']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_109_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_114_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_109_t,Tensor,const Tensor &, int64_t, int64_t>(
-  batch_rule_109_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_114_t,Tensor,const Tensor &, int64_t, int64_t>(
+  batch_rule_114_t batch_rule,
   const Tensor & self, int64_t start_dim, int64_t end_dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2475,10 +2635,10 @@ Tensor lowerToNextLayer<batch_rule_109_t,Tensor,const Tensor &, int64_t, int64_t
 }
 
 // ['flatten.named_out_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_110_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, Dimname);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_115_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, Dimname);
 template <>
-Tensor lowerToNextLayer<batch_rule_110_t,Tensor,const Tensor &, int64_t, int64_t, Dimname>(
-  batch_rule_110_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_115_t,Tensor,const Tensor &, int64_t, int64_t, Dimname>(
+  batch_rule_115_t batch_rule,
   const Tensor & self, int64_t start_dim, int64_t end_dim, Dimname out_dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2493,10 +2653,10 @@ Tensor lowerToNextLayer<batch_rule_110_t,Tensor,const Tensor &, int64_t, int64_t
 }
 
 // ['flatten.using_names']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_111_t)(const Tensor &, c10::optional<int64_t>, Dimname, Dimname, Dimname);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_116_t)(const Tensor &, c10::optional<int64_t>, Dimname, Dimname, Dimname);
 template <>
-Tensor lowerToNextLayer<batch_rule_111_t,Tensor,const Tensor &, Dimname, Dimname, Dimname>(
-  batch_rule_111_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_116_t,Tensor,const Tensor &, Dimname, Dimname, Dimname>(
+  batch_rule_116_t batch_rule,
   const Tensor & self, Dimname start_dim, Dimname end_dim, Dimname out_dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2511,10 +2671,10 @@ Tensor lowerToNextLayer<batch_rule_111_t,Tensor,const Tensor &, Dimname, Dimname
 }
 
 // ['flatten.DimnameList']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_112_t)(const Tensor &, c10::optional<int64_t>, DimnameList, Dimname);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_117_t)(const Tensor &, c10::optional<int64_t>, DimnameList, Dimname);
 template <>
-Tensor lowerToNextLayer<batch_rule_112_t,Tensor,const Tensor &, DimnameList, Dimname>(
-  batch_rule_112_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_117_t,Tensor,const Tensor &, DimnameList, Dimname>(
+  batch_rule_117_t batch_rule,
   const Tensor & self, DimnameList dims, Dimname out_dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2529,10 +2689,10 @@ Tensor lowerToNextLayer<batch_rule_112_t,Tensor,const Tensor &, DimnameList, Dim
 }
 
 // ['unflatten.int']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_113_t)(const Tensor &, c10::optional<int64_t>, int64_t, IntArrayRef, c10::optional<DimnameList>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_118_t)(const Tensor &, c10::optional<int64_t>, int64_t, IntArrayRef, c10::optional<DimnameList>);
 template <>
-Tensor lowerToNextLayer<batch_rule_113_t,Tensor,const Tensor &, int64_t, IntArrayRef, c10::optional<DimnameList>>(
-  batch_rule_113_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_118_t,Tensor,const Tensor &, int64_t, IntArrayRef, c10::optional<DimnameList>>(
+  batch_rule_118_t batch_rule,
   const Tensor & self, int64_t dim, IntArrayRef sizes, c10::optional<DimnameList> names
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2547,10 +2707,10 @@ Tensor lowerToNextLayer<batch_rule_113_t,Tensor,const Tensor &, int64_t, IntArra
 }
 
 // ['unflatten.Dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_114_t)(const Tensor &, c10::optional<int64_t>, Dimname, IntArrayRef, DimnameList);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_119_t)(const Tensor &, c10::optional<int64_t>, Dimname, IntArrayRef, DimnameList);
 template <>
-Tensor lowerToNextLayer<batch_rule_114_t,Tensor,const Tensor &, Dimname, IntArrayRef, DimnameList>(
-  batch_rule_114_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_119_t,Tensor,const Tensor &, Dimname, IntArrayRef, DimnameList>(
+  batch_rule_119_t batch_rule,
   const Tensor & self, Dimname dim, IntArrayRef sizes, DimnameList names
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2565,10 +2725,10 @@ Tensor lowerToNextLayer<batch_rule_114_t,Tensor,const Tensor &, Dimname, IntArra
 }
 
 // ['full_like']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_115_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_120_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_115_t,Tensor,const Tensor &, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
-  batch_rule_115_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_120_t,Tensor,const Tensor &, const Scalar &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
+  batch_rule_120_t batch_rule,
   const Tensor & self, const Scalar & fill_value, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2582,11 +2742,35 @@ Tensor lowerToNextLayer<batch_rule_115_t,Tensor,const Tensor &, const Scalar &,
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['grid_sampler_2d_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_121_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool, ::std::array<bool,2>);
+template <>
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_121_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, bool, ::std::array<bool,2>>(
+  batch_rule_121_t batch_rule,
+  const Tensor & grad_output, const Tensor & input, const Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners, ::std::array<bool,2> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  Tensor grid_value;
+  optional<int64_t> grid_bdim;
+  std::tie(grid_value, grid_bdim) = unwrapTensorAtLevel(grid, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, input_value, input_bdim, grid_value, grid_bdim, interpolation_mode, padding_mode, align_corners, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
+}
+
 // ['_grid_sampler_2d_cpu_fallback_backward', 'grid_sampler_3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_116_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_122_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_116_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, bool>(
-  batch_rule_116_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_122_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, bool>(
+  batch_rule_122_t batch_rule,
   const Tensor & grad_output, const Tensor & input, const Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2607,10 +2791,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_116_t,std::tuple<Tensor,Te
 }
 
 // ['hinge_embedding_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_117_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_123_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_117_t,Tensor,const Tensor &, const Tensor &, double, int64_t>(
-  batch_rule_117_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_123_t,Tensor,const Tensor &, const Tensor &, double, int64_t>(
+  batch_rule_123_t batch_rule,
   const Tensor & self, const Tensor & target, double margin, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2628,10 +2812,10 @@ Tensor lowerToNextLayer<batch_rule_117_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['group_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_118_t)(const Tensor &, c10::optional<int64_t>, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_124_t)(const Tensor &, c10::optional<int64_t>, int64_t, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_118_t,Tensor,const Tensor &, int64_t, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, bool>(
-  batch_rule_118_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_124_t,Tensor,const Tensor &, int64_t, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, bool>(
+  batch_rule_124_t batch_rule,
   const Tensor & input, int64_t num_groups, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, double eps, bool cudnn_enabled
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2656,10 +2840,10 @@ Tensor lowerToNextLayer<batch_rule_118_t,Tensor,const Tensor &, int64_t, const c
 }
 
 // ['native_group_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_119_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, int64_t, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_125_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, int64_t, int64_t, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_119_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t, int64_t, int64_t, int64_t, double>(
-  batch_rule_119_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_125_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t, int64_t, int64_t, int64_t, double>(
+  batch_rule_125_t batch_rule,
   const Tensor & input, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, int64_t N, int64_t C, int64_t HxW, int64_t group, double eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2683,11 +2867,43 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_119_t,std::tuple<Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
 }
 
+// ['native_group_norm_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_126_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, int64_t, int64_t, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_126_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t, int64_t, int64_t, ::std::array<bool,3>>(
+  batch_rule_126_t batch_rule,
+  const Tensor & grad_out, const Tensor & input, const Tensor & mean, const Tensor & rstd, const c10::optional<Tensor> & weight, int64_t N, int64_t C, int64_t HxW, int64_t group, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_out_value;
+  optional<int64_t> grad_out_bdim;
+  std::tie(grad_out_value, grad_out_bdim) = unwrapTensorAtLevel(grad_out, cur_level);
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  Tensor mean_value;
+  optional<int64_t> mean_bdim;
+  std::tie(mean_value, mean_bdim) = unwrapTensorAtLevel(mean, cur_level);
+  Tensor rstd_value;
+  optional<int64_t> rstd_bdim;
+  std::tie(rstd_value, rstd_bdim) = unwrapTensorAtLevel(rstd, cur_level);
+  optional<Tensor> weight_value;
+  optional<int64_t> weight_bdim;
+  if (weight) {
+      std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight.value(), cur_level);
+  }
+  auto results = batch_rule(grad_out_value, grad_out_bdim, input_value, input_bdim, mean_value, mean_bdim, rstd_value, rstd_bdim, weight_value, weight_bdim, N, C, HxW, group, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['_fft_r2c', '_fft_c2c']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_120_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_127_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_120_t,Tensor,const Tensor &, IntArrayRef, int64_t, bool>(
-  batch_rule_120_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_127_t,Tensor,const Tensor &, IntArrayRef, int64_t, bool>(
+  batch_rule_127_t batch_rule,
   const Tensor & self, IntArrayRef dim, int64_t normalization, bool onesided
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2702,10 +2918,10 @@ Tensor lowerToNextLayer<batch_rule_120_t,Tensor,const Tensor &, IntArrayRef, int
 }
 
 // ['_fft_c2r', 'select_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_121_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_128_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_121_t,Tensor,const Tensor &, IntArrayRef, int64_t, int64_t>(
-  batch_rule_121_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_128_t,Tensor,const Tensor &, IntArrayRef, int64_t, int64_t>(
+  batch_rule_128_t batch_rule,
   const Tensor & self, IntArrayRef dim, int64_t normalization, int64_t last_dim_size
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2720,10 +2936,10 @@ Tensor lowerToNextLayer<batch_rule_121_t,Tensor,const Tensor &, IntArrayRef, int
 }
 
 // ['index.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_122_t)(const Tensor &, c10::optional<int64_t>, const c10::List<c10::optional<Tensor>> &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_129_t)(const Tensor &, c10::optional<int64_t>, const c10::List<c10::optional<Tensor>> &);
 template <>
-Tensor lowerToNextLayer<batch_rule_122_t,Tensor,const Tensor &, const c10::List<c10::optional<Tensor>> &>(
-  batch_rule_122_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_129_t,Tensor,const Tensor &, const c10::List<c10::optional<Tensor>> &>(
+  batch_rule_129_t batch_rule,
   const Tensor & self, const c10::List<c10::optional<Tensor>> & indices
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2738,10 +2954,10 @@ Tensor lowerToNextLayer<batch_rule_122_t,Tensor,const Tensor &, const c10::List<
 }
 
 // ['index_copy', 'index_add', 'index_fill.int_Tensor', 'scatter.src', 'scatter_add', '_gather_sparse_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_123_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_130_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_123_t,Tensor,const Tensor &, int64_t, const Tensor &, const Tensor &>(
-  batch_rule_123_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_130_t,Tensor,const Tensor &, int64_t, const Tensor &, const Tensor &>(
+  batch_rule_130_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, const Tensor & source
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2762,10 +2978,10 @@ Tensor lowerToNextLayer<batch_rule_123_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['index_copy.dimname', 'index_fill.Dimname_Tensor', 'scatter.dimname_src', 'scatter_add.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_124_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_131_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_124_t,Tensor,const Tensor &, Dimname, const Tensor &, const Tensor &>(
-  batch_rule_124_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_131_t,Tensor,const Tensor &, Dimname, const Tensor &, const Tensor &>(
+  batch_rule_131_t batch_rule,
   const Tensor & self, Dimname dim, const Tensor & index, const Tensor & source
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2786,10 +3002,10 @@ Tensor lowerToNextLayer<batch_rule_124_t,Tensor,const Tensor &, Dimname, const T
 }
 
 // ['index_put']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_125_t)(const Tensor &, c10::optional<int64_t>, const c10::List<c10::optional<Tensor>> &, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_132_t)(const Tensor &, c10::optional<int64_t>, const c10::List<c10::optional<Tensor>> &, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_125_t,Tensor,const Tensor &, const c10::List<c10::optional<Tensor>> &, const Tensor &, bool>(
-  batch_rule_125_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_132_t,Tensor,const Tensor &, const c10::List<c10::optional<Tensor>> &, const Tensor &, bool>(
+  batch_rule_132_t batch_rule,
   const Tensor & self, const c10::List<c10::optional<Tensor>> & indices, const Tensor & values, bool accumulate
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2807,10 +3023,10 @@ Tensor lowerToNextLayer<batch_rule_125_t,Tensor,const Tensor &, const c10::List<
 }
 
 // ['isclose', 'pairwise_distance']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_126_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, double, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_133_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, double, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_126_t,Tensor,const Tensor &, const Tensor &, double, double, bool>(
-  batch_rule_126_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_133_t,Tensor,const Tensor &, const Tensor &, double, double, bool>(
+  batch_rule_133_t batch_rule,
   const Tensor & self, const Tensor & other, double rtol, double atol, bool equal_nan
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2828,10 +3044,10 @@ Tensor lowerToNextLayer<batch_rule_126_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['isin.Tensor_Tensor', 'bucketize.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_127_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_134_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_127_t,Tensor,const Tensor &, const Tensor &, bool, bool>(
-  batch_rule_127_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_134_t,Tensor,const Tensor &, const Tensor &, bool, bool>(
+  batch_rule_134_t batch_rule,
   const Tensor & elements, const Tensor & test_elements, bool assume_unique, bool invert
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2849,10 +3065,10 @@ Tensor lowerToNextLayer<batch_rule_127_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['isin.Tensor_Scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_128_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_135_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_128_t,Tensor,const Tensor &, const Scalar &, bool, bool>(
-  batch_rule_128_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_135_t,Tensor,const Tensor &, const Scalar &, bool, bool>(
+  batch_rule_135_t batch_rule,
   const Tensor & elements, const Scalar & test_element, bool assume_unique, bool invert
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2867,10 +3083,10 @@ Tensor lowerToNextLayer<batch_rule_128_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['isin.Scalar_Tensor', 'bucketize.Scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_129_t)(const Scalar &, const Tensor &, c10::optional<int64_t>, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_136_t)(const Scalar &, const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_129_t,Tensor,const Scalar &, const Tensor &, bool, bool>(
-  batch_rule_129_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_136_t,Tensor,const Scalar &, const Tensor &, bool, bool>(
+  batch_rule_136_t batch_rule,
   const Scalar & element, const Tensor & test_elements, bool assume_unique, bool invert
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2885,10 +3101,10 @@ Tensor lowerToNextLayer<batch_rule_129_t,Tensor,const Scalar &, const Tensor &,
 }
 
 // ['is_same_size', '_has_compatible_shallow_copy_type', 'is_set_to', 'equal']
-typedef std::tuple<bool> (*batch_rule_130_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<bool> (*batch_rule_137_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-bool lowerToNextLayer<batch_rule_130_t,bool,const Tensor &, const Tensor &>(
-  batch_rule_130_t batch_rule,
+bool lowerToNextLayer<batch_rule_137_t,bool,const Tensor &, const Tensor &>(
+  batch_rule_137_t batch_rule,
   const Tensor & self, const Tensor & other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2906,10 +3122,10 @@ bool lowerToNextLayer<batch_rule_130_t,bool,const Tensor &, const Tensor &>(
 }
 
 // ['kl_div']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_131_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_138_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_131_t,Tensor,const Tensor &, const Tensor &, int64_t, bool>(
-  batch_rule_131_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_138_t,Tensor,const Tensor &, const Tensor &, int64_t, bool>(
+  batch_rule_138_t batch_rule,
   const Tensor & self, const Tensor & target, int64_t reduction, bool log_target
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2927,10 +3143,10 @@ Tensor lowerToNextLayer<batch_rule_131_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['kl_div_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_132_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_139_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_132_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, bool>(
-  batch_rule_132_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_139_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, bool>(
+  batch_rule_139_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction, bool log_target
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2951,10 +3167,10 @@ Tensor lowerToNextLayer<batch_rule_132_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['kthvalue']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_133_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_140_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_133_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, int64_t, bool>(
-  batch_rule_133_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_140_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, int64_t, bool>(
+  batch_rule_140_t batch_rule,
   const Tensor & self, int64_t k, int64_t dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2969,10 +3185,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_133_t,std::tuple<Tensor,Te
 }
 
 // ['kthvalue.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_134_t)(const Tensor &, c10::optional<int64_t>, int64_t, Dimname, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_141_t)(const Tensor &, c10::optional<int64_t>, int64_t, Dimname, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_134_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, Dimname, bool>(
-  batch_rule_134_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_141_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, Dimname, bool>(
+  batch_rule_141_t batch_rule,
   const Tensor & self, int64_t k, Dimname dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -2987,10 +3203,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_134_t,std::tuple<Tensor,Te
 }
 
 // ['layer_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_135_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_142_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_135_t,Tensor,const Tensor &, IntArrayRef, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, bool>(
-  batch_rule_135_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_142_t,Tensor,const Tensor &, IntArrayRef, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, bool>(
+  batch_rule_142_t batch_rule,
   const Tensor & input, IntArrayRef normalized_shape, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, double eps, bool cudnn_enable
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3015,10 +3231,10 @@ Tensor lowerToNextLayer<batch_rule_135_t,Tensor,const Tensor &, IntArrayRef, con
 }
 
 // ['native_layer_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_136_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_143_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_136_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, IntArrayRef, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double>(
-  batch_rule_136_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_143_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, IntArrayRef, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double>(
+  batch_rule_143_t batch_rule,
   const Tensor & input, IntArrayRef normalized_shape, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, double eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3042,11 +3258,48 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_136_t,std::tuple<Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
 }
 
+// ['native_layer_norm_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_144_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_144_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, ::std::array<bool,3>>(
+  batch_rule_144_t batch_rule,
+  const Tensor & grad_out, const Tensor & input, IntArrayRef normalized_shape, const Tensor & mean, const Tensor & rstd, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_out_value;
+  optional<int64_t> grad_out_bdim;
+  std::tie(grad_out_value, grad_out_bdim) = unwrapTensorAtLevel(grad_out, cur_level);
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  Tensor mean_value;
+  optional<int64_t> mean_bdim;
+  std::tie(mean_value, mean_bdim) = unwrapTensorAtLevel(mean, cur_level);
+  Tensor rstd_value;
+  optional<int64_t> rstd_bdim;
+  std::tie(rstd_value, rstd_bdim) = unwrapTensorAtLevel(rstd, cur_level);
+  optional<Tensor> weight_value;
+  optional<int64_t> weight_bdim;
+  if (weight) {
+      std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight.value(), cur_level);
+  }
+  optional<Tensor> bias_value;
+  optional<int64_t> bias_bdim;
+  if (bias) {
+      std::tie(bias_value, bias_bdim) = unwrapTensorAtLevel(bias.value(), cur_level);
+  }
+  auto results = batch_rule(grad_out_value, grad_out_bdim, input_value, input_bdim, normalized_shape, mean_value, mean_bdim, rstd_value, rstd_bdim, weight_value, weight_bdim, bias_value, bias_bdim, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['nan_to_num']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_137_t)(const Tensor &, c10::optional<int64_t>, c10::optional<double>, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_145_t)(const Tensor &, c10::optional<int64_t>, c10::optional<double>, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_137_t,Tensor,const Tensor &, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
-  batch_rule_137_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_145_t,Tensor,const Tensor &, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
+  batch_rule_145_t batch_rule,
   const Tensor & self, c10::optional<double> nan, c10::optional<double> posinf, c10::optional<double> neginf
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3061,10 +3314,10 @@ Tensor lowerToNextLayer<batch_rule_137_t,Tensor,const Tensor &, c10::optional<do
 }
 
 // ['linear', 'mkldnn_linear']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_138_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_146_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_138_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &>(
-  batch_rule_138_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_146_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &>(
+  batch_rule_146_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3087,10 +3340,10 @@ Tensor lowerToNextLayer<batch_rule_138_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['mkldnn_linear_backward_input']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_139_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_147_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_139_t,Tensor,IntArrayRef, const Tensor &, const Tensor &>(
-  batch_rule_139_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_147_t,Tensor,IntArrayRef, const Tensor &, const Tensor &>(
+  batch_rule_147_t batch_rule,
   IntArrayRef input_size, const Tensor & grad_output, const Tensor & weight
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3108,10 +3361,10 @@ Tensor lowerToNextLayer<batch_rule_139_t,Tensor,IntArrayRef, const Tensor &, con
 }
 
 // ['mkldnn_linear_backward_weights']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_140_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_148_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_140_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool>(
-  batch_rule_140_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_148_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, bool>(
+  batch_rule_148_t batch_rule,
   const Tensor & grad_output, const Tensor & input, const Tensor & weight, bool bias_defined
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3131,11 +3384,35 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_140_t,std::tuple<Tensor,Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
 }
 
+// ['mkldnn_linear_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_149_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_149_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, ::std::array<bool,3>>(
+  batch_rule_149_t batch_rule,
+  const Tensor & self, const Tensor & grad_output, const Tensor & weight, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(self_value, self_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['fbgemm_linear_int8_weight_fp32_activation', 'fbgemm_linear_int8_weight']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_141_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_150_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_141_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, const Tensor &>(
-  batch_rule_141_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_150_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, const Tensor &>(
+  batch_rule_150_t batch_rule,
   const Tensor & input, const Tensor & weight, const Tensor & packed, const Tensor & col_offsets, const Scalar & weight_scale, const Scalar & weight_zero_point, const Tensor & bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3162,10 +3439,10 @@ Tensor lowerToNextLayer<batch_rule_141_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['fbgemm_linear_quantize_weight']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,double,int64_t> (*batch_rule_142_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,double,int64_t> (*batch_rule_151_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,double,int64_t> lowerToNextLayer<batch_rule_142_t,std::tuple<Tensor,Tensor,double,int64_t>,const Tensor &>(
-  batch_rule_142_t batch_rule,
+std::tuple<Tensor,Tensor,double,int64_t> lowerToNextLayer<batch_rule_151_t,std::tuple<Tensor,Tensor,double,int64_t>,const Tensor &>(
+  batch_rule_151_t batch_rule,
   const Tensor & input
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3180,10 +3457,10 @@ std::tuple<Tensor,Tensor,double,int64_t> lowerToNextLayer<batch_rule_142_t,std::
 }
 
 // ['fbgemm_linear_fp16_weight_fp32_activation', 'fbgemm_linear_fp16_weight', 'where.self', '_s_where', '_dirichlet_grad', 'masked_fill.Tensor', 'masked_scatter', 'masked_select_backward', 'lu_solve', 'lerp.Tensor', 'log_sigmoid_backward', 'adaptive_max_pool2d_backward', 'adaptive_max_pool3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_143_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_152_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_143_t,Tensor,const Tensor &, const Tensor &, const Tensor &>(
-  batch_rule_143_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_152_t,Tensor,const Tensor &, const Tensor &, const Tensor &>(
+  batch_rule_152_t batch_rule,
   const Tensor & input, const Tensor & packed_weight, const Tensor & bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3204,10 +3481,10 @@ Tensor lowerToNextLayer<batch_rule_143_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['xlogy.Scalar_Self', 'bitwise_left_shift.Scalar_Tensor', 'bitwise_right_shift.Scalar_Tensor', 'remainder.Scalar_Tensor', 'pow.Scalar', 'float_power.Scalar', 'special_xlog1py.self_scalar', 'special_xlogy.self_scalar', 'special_zeta.self_scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_144_t)(const Scalar &, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_153_t)(const Scalar &, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_144_t,Tensor,const Scalar &, const Tensor &>(
-  batch_rule_144_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_153_t,Tensor,const Scalar &, const Tensor &>(
+  batch_rule_153_t batch_rule,
   const Scalar & self, const Tensor & other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3222,10 +3499,10 @@ Tensor lowerToNextLayer<batch_rule_144_t,Tensor,const Scalar &, const Tensor &>(
 }
 
 // ['_log_softmax_backward_data', '_softmax_backward_data']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_145_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_154_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_145_t,Tensor,const Tensor &, const Tensor &, int64_t, ScalarType>(
-  batch_rule_145_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_154_t,Tensor,const Tensor &, const Tensor &, int64_t, ScalarType>(
+  batch_rule_154_t batch_rule,
   const Tensor & grad_output, const Tensor & output, int64_t dim, ScalarType input_dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3243,10 +3520,10 @@ Tensor lowerToNextLayer<batch_rule_145_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['logcumsumexp.dimname', 'squeeze.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_146_t)(const Tensor &, c10::optional<int64_t>, Dimname);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_155_t)(const Tensor &, c10::optional<int64_t>, Dimname);
 template <>
-Tensor lowerToNextLayer<batch_rule_146_t,Tensor,const Tensor &, Dimname>(
-  batch_rule_146_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_155_t,Tensor,const Tensor &, Dimname>(
+  batch_rule_155_t batch_rule,
   const Tensor & self, Dimname dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3261,10 +3538,10 @@ Tensor lowerToNextLayer<batch_rule_146_t,Tensor,const Tensor &, Dimname>(
 }
 
 // ['logsumexp.names']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_147_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_156_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_147_t,Tensor,const Tensor &, DimnameList, bool>(
-  batch_rule_147_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_156_t,Tensor,const Tensor &, DimnameList, bool>(
+  batch_rule_156_t batch_rule,
   const Tensor & self, DimnameList dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3279,10 +3556,10 @@ Tensor lowerToNextLayer<batch_rule_147_t,Tensor,const Tensor &, DimnameList, boo
 }
 
 // ['_aminmax', 'slogdet', 'frexp.Tensor', 'geqrf', 'log_sigmoid_forward', 'linalg_slogdet', 'linalg_eig']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_148_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_157_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_148_t,std::tuple<Tensor,Tensor>,const Tensor &>(
-  batch_rule_148_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_157_t,std::tuple<Tensor,Tensor>,const Tensor &>(
+  batch_rule_157_t batch_rule,
   const Tensor & self
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3297,10 +3574,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_148_t,std::tuple<Tensor,Te
 }
 
 // ['_aminmax.dim', 'max.dim', 'median.dim', 'nanmedian.dim', 'min.dim', 'mode', 'sort']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_149_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_158_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_149_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, bool>(
-  batch_rule_149_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_158_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, bool>(
+  batch_rule_158_t batch_rule,
   const Tensor & self, int64_t dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3315,10 +3592,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_149_t,std::tuple<Tensor,Te
 }
 
 // ['aminmax']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_150_t)(const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_159_t)(const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_150_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<int64_t>, bool>(
-  batch_rule_150_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_159_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<int64_t>, bool>(
+  batch_rule_159_t batch_rule,
   const Tensor & self, c10::optional<int64_t> dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3333,10 +3610,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_150_t,std::tuple<Tensor,Te
 }
 
 // ['max.names_dim', 'median.names_dim', 'nanmedian.names_dim', 'min.names_dim', 'mode.dimname', 'sort.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_151_t)(const Tensor &, c10::optional<int64_t>, Dimname, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_160_t)(const Tensor &, c10::optional<int64_t>, Dimname, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_151_t,std::tuple<Tensor,Tensor>,const Tensor &, Dimname, bool>(
-  batch_rule_151_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_160_t,std::tuple<Tensor,Tensor>,const Tensor &, Dimname, bool>(
+  batch_rule_160_t batch_rule,
   const Tensor & self, Dimname dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3351,10 +3628,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_151_t,std::tuple<Tensor,Te
 }
 
 // ['value_selecting_reduction_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_152_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, IntArrayRef, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_161_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, IntArrayRef, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_152_t,Tensor,const Tensor &, int64_t, const Tensor &, IntArrayRef, bool>(
-  batch_rule_152_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_161_t,Tensor,const Tensor &, int64_t, const Tensor &, IntArrayRef, bool>(
+  batch_rule_161_t batch_rule,
   const Tensor & grad, int64_t dim, const Tensor & indices, IntArrayRef sizes, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3372,10 +3649,10 @@ Tensor lowerToNextLayer<batch_rule_152_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['max_pool1d_with_indices', 'max_pool2d_with_indices', 'max_pool3d_with_indices']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_153_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_162_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_153_t,std::tuple<Tensor,Tensor>,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool>(
-  batch_rule_153_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_162_t,std::tuple<Tensor,Tensor>,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool>(
+  batch_rule_162_t batch_rule,
   const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3390,10 +3667,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_153_t,std::tuple<Tensor,Te
 }
 
 // ['max_pool1d', 'max_pool2d', 'mkldnn_max_pool2d', 'mkldnn_max_pool3d', 'quantized_max_pool1d', 'quantized_max_pool2d', 'max_pool3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_154_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_163_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_154_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool>(
-  batch_rule_154_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_163_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool>(
+  batch_rule_163_t batch_rule,
   const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3408,10 +3685,10 @@ Tensor lowerToNextLayer<batch_rule_154_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['mkldnn_max_pool2d_backward', 'mkldnn_max_pool3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_155_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_164_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_155_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool>(
-  batch_rule_155_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_164_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool>(
+  batch_rule_164_t batch_rule,
   const Tensor & grad_output, const Tensor & output, const Tensor & input, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3432,10 +3709,10 @@ Tensor lowerToNextLayer<batch_rule_155_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['mean', 'sum', 'nansum', 'prod', 'to_dense', 'to_mkldnn']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_156_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_165_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_156_t,Tensor,const Tensor &, c10::optional<ScalarType>>(
-  batch_rule_156_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_165_t,Tensor,const Tensor &, c10::optional<ScalarType>>(
+  batch_rule_165_t batch_rule,
   const Tensor & self, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3450,10 +3727,10 @@ Tensor lowerToNextLayer<batch_rule_156_t,Tensor,const Tensor &, c10::optional<Sc
 }
 
 // ['mean.dim', 'nanmean', 'sum.dim_IntList', 'nansum.dim_IntList']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_157_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_166_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_157_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<ScalarType>>(
-  batch_rule_157_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_166_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<ScalarType>>(
+  batch_rule_166_t batch_rule,
   const Tensor & self, IntArrayRef dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3468,10 +3745,10 @@ Tensor lowerToNextLayer<batch_rule_157_t,Tensor,const Tensor &, IntArrayRef, boo
 }
 
 // ['mean.names_dim', 'sum.dim_DimnameList']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_158_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_167_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_158_t,Tensor,const Tensor &, DimnameList, bool, c10::optional<ScalarType>>(
-  batch_rule_158_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_167_t,Tensor,const Tensor &, DimnameList, bool, c10::optional<ScalarType>>(
+  batch_rule_167_t batch_rule,
   const Tensor & self, DimnameList dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3486,10 +3763,10 @@ Tensor lowerToNextLayer<batch_rule_158_t,Tensor,const Tensor &, DimnameList, boo
 }
 
 // ['mkldnn_convolution_backward_input']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_159_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_168_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_159_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool>(
-  batch_rule_159_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_168_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool>(
+  batch_rule_168_t batch_rule,
   IntArrayRef self_size, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool bias_defined
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3507,10 +3784,10 @@ Tensor lowerToNextLayer<batch_rule_159_t,Tensor,IntArrayRef, const Tensor &, con
 }
 
 // ['mkldnn_convolution_backward_weights']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_160_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_169_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_160_t,std::tuple<Tensor,Tensor>,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool>(
-  batch_rule_160_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_169_t,std::tuple<Tensor,Tensor>,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool>(
+  batch_rule_169_t batch_rule,
   IntArrayRef weight_size, const Tensor & grad_output, const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool bias_defined
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3527,11 +3804,35 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_160_t,std::tuple<Tensor,Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
 }
 
+// ['mkldnn_convolution_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_170_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_170_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, ::std::array<bool,3>>(
+  batch_rule_170_t batch_rule,
+  const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(self_value, self_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, padding, stride, dilation, groups, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['miopen_batch_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_161_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_171_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_161_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, double>(
-  batch_rule_161_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_171_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, double>(
+  batch_rule_171_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, bool training, double exponential_average_factor, double epsilon
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3564,10 +3865,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_161_t,std::tuple<Te
 }
 
 // ['miopen_batch_norm_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_162_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_172_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_162_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double>(
-  batch_rule_162_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_172_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double>(
+  batch_rule_172_t batch_rule,
   const Tensor & input, const Tensor & grad_output, const Tensor & weight, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, const c10::optional<Tensor> & save_mean, const c10::optional<Tensor> & save_var, double epsilon
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3608,10 +3909,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_162_t,std::tuple<Te
 }
 
 // ['miopen_convolution_backward_input', 'miopen_convolution_backward_weight', 'miopen_convolution_transpose_backward_weight', 'miopen_depthwise_convolution_backward_input', 'miopen_depthwise_convolution_backward_weight']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_163_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_173_t)(IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_163_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
-  batch_rule_163_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_173_t,Tensor,IntArrayRef, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool>(
+  batch_rule_173_t batch_rule,
   IntArrayRef self_size, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3628,11 +3929,59 @@ Tensor lowerToNextLayer<batch_rule_163_t,Tensor,IntArrayRef, const Tensor &, con
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['miopen_convolution_backward', 'miopen_depthwise_convolution_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_174_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_174_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, ::std::array<bool,3>>(
+  batch_rule_174_t batch_rule,
+  const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(self_value, self_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, padding, stride, dilation, groups, benchmark, deterministic, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
+// ['miopen_convolution_transpose_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_175_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_175_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t, bool, bool, ::std::array<bool,3>>(
+  batch_rule_175_t batch_rule,
+  const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(self_value, self_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, padding, output_padding, stride, dilation, groups, benchmark, deterministic, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['narrow.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_164_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_176_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_164_t,Tensor,const Tensor &, int64_t, const Tensor &, int64_t>(
-  batch_rule_164_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_176_t,Tensor,const Tensor &, int64_t, const Tensor &, int64_t>(
+  batch_rule_176_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & start, int64_t length
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3650,10 +3999,10 @@ Tensor lowerToNextLayer<batch_rule_164_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['native_batch_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_165_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_177_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_165_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, double>(
-  batch_rule_165_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_177_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, double>(
+  batch_rule_177_t batch_rule,
   const Tensor & input, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, bool training, double momentum, double eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3688,10 +4037,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_165_t,std::tuple<Te
 }
 
 // ['batch_norm_stats']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_166_t)(const Tensor &, c10::optional<int64_t>, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_178_t)(const Tensor &, c10::optional<int64_t>, double);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_166_t,std::tuple<Tensor,Tensor>,const Tensor &, double>(
-  batch_rule_166_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_178_t,std::tuple<Tensor,Tensor>,const Tensor &, double>(
+  batch_rule_178_t batch_rule,
   const Tensor & input, double eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3706,10 +4055,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_166_t,std::tuple<Tensor,Te
 }
 
 // ['batch_norm_elemt']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_167_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_179_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_167_t,Tensor,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, double>(
-  batch_rule_167_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_179_t,Tensor,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, double>(
+  batch_rule_179_t batch_rule,
   const Tensor & input, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & bias, const Tensor & mean, const Tensor & invstd, double eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3740,10 +4089,10 @@ Tensor lowerToNextLayer<batch_rule_167_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['batch_norm_gather_stats']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_168_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, double, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_180_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, double, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_168_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, double, int64_t>(
-  batch_rule_168_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_180_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, double, int64_t>(
+  batch_rule_180_t batch_rule,
   const Tensor & input, const Tensor & mean, const Tensor & invstd, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, double momentum, double eps, int64_t count
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3774,10 +4123,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_168_t,std::tuple<Tensor,Te
 }
 
 // ['batch_norm_gather_stats_with_counts']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_169_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, double, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_181_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double, double, const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_169_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, double, const Tensor &>(
-  batch_rule_169_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_181_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double, double, const Tensor &>(
+  batch_rule_181_t batch_rule,
   const Tensor & input, const Tensor & mean, const Tensor & invstd, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, double momentum, double eps, const Tensor & counts
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3810,11 +4159,57 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_169_t,std::tuple<Tensor,Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
 }
 
+// ['native_batch_norm_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_182_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, double, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_182_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool, double, ::std::array<bool,3>>(
+  batch_rule_182_t batch_rule,
+  const Tensor & grad_out, const Tensor & input, const c10::optional<Tensor> & weight, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, const c10::optional<Tensor> & save_mean, const c10::optional<Tensor> & save_invstd, bool train, double eps, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_out_value;
+  optional<int64_t> grad_out_bdim;
+  std::tie(grad_out_value, grad_out_bdim) = unwrapTensorAtLevel(grad_out, cur_level);
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  optional<Tensor> weight_value;
+  optional<int64_t> weight_bdim;
+  if (weight) {
+      std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight.value(), cur_level);
+  }
+  optional<Tensor> running_mean_value;
+  optional<int64_t> running_mean_bdim;
+  if (running_mean) {
+      std::tie(running_mean_value, running_mean_bdim) = unwrapTensorAtLevel(running_mean.value(), cur_level);
+  }
+  optional<Tensor> running_var_value;
+  optional<int64_t> running_var_bdim;
+  if (running_var) {
+      std::tie(running_var_value, running_var_bdim) = unwrapTensorAtLevel(running_var.value(), cur_level);
+  }
+  optional<Tensor> save_mean_value;
+  optional<int64_t> save_mean_bdim;
+  if (save_mean) {
+      std::tie(save_mean_value, save_mean_bdim) = unwrapTensorAtLevel(save_mean.value(), cur_level);
+  }
+  optional<Tensor> save_invstd_value;
+  optional<int64_t> save_invstd_bdim;
+  if (save_invstd) {
+      std::tie(save_invstd_value, save_invstd_bdim) = unwrapTensorAtLevel(save_invstd.value(), cur_level);
+  }
+  auto results = batch_rule(grad_out_value, grad_out_bdim, input_value, input_bdim, weight_value, weight_bdim, running_mean_value, running_mean_bdim, running_var_value, running_var_bdim, save_mean_value, save_mean_bdim, save_invstd_value, save_invstd_bdim, train, eps, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['batch_norm_backward_reduce']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_170_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_183_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, bool, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_170_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, bool, bool, bool>(
-  batch_rule_170_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_183_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, bool, bool, bool>(
+  batch_rule_183_t batch_rule,
   const Tensor & grad_out, const Tensor & input, const Tensor & mean, const Tensor & invstd, const c10::optional<Tensor> & weight, bool input_g, bool weight_g, bool bias_g
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3843,10 +4238,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_170_t,std::t
 }
 
 // ['batch_norm_backward_elemt']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_171_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_184_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_171_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const Tensor &>(
-  batch_rule_171_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_184_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const Tensor &>(
+  batch_rule_184_t batch_rule,
   const Tensor & grad_out, const Tensor & input, const Tensor & mean, const Tensor & invstd, const c10::optional<Tensor> & weight, const Tensor & mean_dy, const Tensor & mean_dy_xmu, const Tensor & count
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3884,10 +4279,10 @@ Tensor lowerToNextLayer<batch_rule_171_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['batch_norm_update_stats']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_172_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_185_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, double);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_172_t,std::tuple<Tensor,Tensor>,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double>(
-  batch_rule_172_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_185_t,std::tuple<Tensor,Tensor>,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, double>(
+  batch_rule_185_t batch_rule,
   const Tensor & input, const c10::optional<Tensor> & running_mean, const c10::optional<Tensor> & running_var, double momentum
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3912,10 +4307,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_172_t,std::tuple<Tensor,Te
 }
 
 // ['_nnpack_spatial_convolution']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_173_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_186_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_173_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
-  batch_rule_173_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_186_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
+  batch_rule_186_t batch_rule,
   const Tensor & input, const Tensor & weight, const c10::optional<Tensor> & bias, IntArrayRef padding, IntArrayRef stride
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3937,11 +4332,35 @@ Tensor lowerToNextLayer<batch_rule_173_t,Tensor,const Tensor &, const Tensor &,
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['_nnpack_spatial_convolution_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_187_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_187_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, ::std::array<bool,3>>(
+  batch_rule_187_t batch_rule,
+  const Tensor & input, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor input_value;
+  optional<int64_t> input_bdim;
+  std::tie(input_value, input_bdim) = unwrapTensorAtLevel(input, cur_level);
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(input_value, input_bdim, grad_output_value, grad_output_bdim, weight_value, weight_bdim, padding, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['_nnpack_spatial_convolution_backward_input', 'max_unpool2d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_174_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_188_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_174_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef>(
-  batch_rule_174_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_188_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef>(
+  batch_rule_188_t batch_rule,
   const Tensor & input, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3962,10 +4381,10 @@ Tensor lowerToNextLayer<batch_rule_174_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_nnpack_spatial_convolution_backward_weight']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_175_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Tensor &, c10::optional<int64_t>, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_189_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Tensor &, c10::optional<int64_t>, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_175_t,Tensor,const Tensor &, IntArrayRef, const Tensor &, IntArrayRef>(
-  batch_rule_175_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_189_t,Tensor,const Tensor &, IntArrayRef, const Tensor &, IntArrayRef>(
+  batch_rule_189_t batch_rule,
   const Tensor & input, IntArrayRef weightsize, const Tensor & grad_output, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -3983,10 +4402,10 @@ Tensor lowerToNextLayer<batch_rule_175_t,Tensor,const Tensor &, IntArrayRef, con
 }
 
 // ['cdist', '_cdist_forward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_176_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_190_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_176_t,Tensor,const Tensor &, const Tensor &, double, c10::optional<int64_t>>(
-  batch_rule_176_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_190_t,Tensor,const Tensor &, const Tensor &, double, c10::optional<int64_t>>(
+  batch_rule_190_t batch_rule,
   const Tensor & x1, const Tensor & x2, double p, c10::optional<int64_t> compute_mode
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4004,10 +4423,10 @@ Tensor lowerToNextLayer<batch_rule_176_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_cdist_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_177_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_191_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_177_t,Tensor,const Tensor &, const Tensor &, const Tensor &, double, const Tensor &>(
-  batch_rule_177_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_191_t,Tensor,const Tensor &, const Tensor &, const Tensor &, double, const Tensor &>(
+  batch_rule_191_t batch_rule,
   const Tensor & grad, const Tensor & x1, const Tensor & x2, double p, const Tensor & cdist
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4031,10 +4450,10 @@ Tensor lowerToNextLayer<batch_rule_177_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['pdist', '_pdist_forward', 'pinverse']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_178_t)(const Tensor &, c10::optional<int64_t>, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_192_t)(const Tensor &, c10::optional<int64_t>, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_178_t,Tensor,const Tensor &, double>(
-  batch_rule_178_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_192_t,Tensor,const Tensor &, double>(
+  batch_rule_192_t batch_rule,
   const Tensor & self, double p
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4049,10 +4468,10 @@ Tensor lowerToNextLayer<batch_rule_178_t,Tensor,const Tensor &, double>(
 }
 
 // ['_pdist_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_179_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_193_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_179_t,Tensor,const Tensor &, const Tensor &, double, const Tensor &>(
-  batch_rule_179_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_193_t,Tensor,const Tensor &, const Tensor &, double, const Tensor &>(
+  batch_rule_193_t batch_rule,
   const Tensor & grad, const Tensor & self, double p, const Tensor & pdist
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4073,10 +4492,10 @@ Tensor lowerToNextLayer<batch_rule_179_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['cosine_similarity', 'smooth_l1_loss', 'huber_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_180_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_194_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_180_t,Tensor,const Tensor &, const Tensor &, int64_t, double>(
-  batch_rule_180_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_194_t,Tensor,const Tensor &, const Tensor &, int64_t, double>(
+  batch_rule_194_t batch_rule,
   const Tensor & x1, const Tensor & x2, int64_t dim, double eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4094,10 +4513,10 @@ Tensor lowerToNextLayer<batch_rule_180_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['movedim.intlist', 'moveaxis.intlist', '_reshape_alias', 'roll']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_181_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_195_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_181_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef>(
-  batch_rule_181_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_195_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef>(
+  batch_rule_195_t batch_rule,
   const Tensor & self, IntArrayRef source, IntArrayRef destination
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4112,10 +4531,10 @@ Tensor lowerToNextLayer<batch_rule_181_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['is_pinned']
-typedef std::tuple<bool> (*batch_rule_182_t)(const Tensor &, c10::optional<int64_t>, c10::optional<Device>);
+typedef std::tuple<bool> (*batch_rule_196_t)(const Tensor &, c10::optional<int64_t>, c10::optional<Device>);
 template <>
-bool lowerToNextLayer<batch_rule_182_t,bool,const Tensor &, c10::optional<Device>>(
-  batch_rule_182_t batch_rule,
+bool lowerToNextLayer<batch_rule_196_t,bool,const Tensor &, c10::optional<Device>>(
+  batch_rule_196_t batch_rule,
   const Tensor & self, c10::optional<Device> device
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4130,10 +4549,10 @@ bool lowerToNextLayer<batch_rule_182_t,bool,const Tensor &, c10::optional<Device
 }
 
 // ['pin_memory', '_pin_memory']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_183_t)(const Tensor &, c10::optional<int64_t>, c10::optional<Device>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_197_t)(const Tensor &, c10::optional<int64_t>, c10::optional<Device>);
 template <>
-Tensor lowerToNextLayer<batch_rule_183_t,Tensor,const Tensor &, c10::optional<Device>>(
-  batch_rule_183_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_197_t,Tensor,const Tensor &, c10::optional<Device>>(
+  batch_rule_197_t batch_rule,
   const Tensor & self, c10::optional<Device> device
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4148,10 +4567,10 @@ Tensor lowerToNextLayer<batch_rule_183_t,Tensor,const Tensor &, c10::optional<De
 }
 
 // ['poisson_nll_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_184_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, double, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_198_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, double, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_184_t,Tensor,const Tensor &, const Tensor &, bool, bool, double, int64_t>(
-  batch_rule_184_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_198_t,Tensor,const Tensor &, const Tensor &, bool, bool, double, int64_t>(
+  batch_rule_198_t batch_rule,
   const Tensor & input, const Tensor & target, bool log_input, bool full, double eps, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4169,10 +4588,10 @@ Tensor lowerToNextLayer<batch_rule_184_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['randint_like']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_185_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_199_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_185_t,Tensor,const Tensor &, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
-  batch_rule_185_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_199_t,Tensor,const Tensor &, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
+  batch_rule_199_t batch_rule,
   const Tensor & self, int64_t high, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4187,10 +4606,10 @@ Tensor lowerToNextLayer<batch_rule_185_t,Tensor,const Tensor &, int64_t, c10::op
 }
 
 // ['randint_like.low_dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_186_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_200_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_186_t,Tensor,const Tensor &, int64_t, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
-  batch_rule_186_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_200_t,Tensor,const Tensor &, int64_t, int64_t, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, c10::optional<MemoryFormat>>(
+  batch_rule_200_t batch_rule,
   const Tensor & self, int64_t low, int64_t high, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4205,10 +4624,10 @@ Tensor lowerToNextLayer<batch_rule_186_t,Tensor,const Tensor &, int64_t, int64_t
 }
 
 // ['repeat_interleave.self_Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_187_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_201_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_187_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>>(
-  batch_rule_187_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_201_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>>(
+  batch_rule_201_t batch_rule,
   const Tensor & self, const Tensor & repeats, c10::optional<int64_t> dim, c10::optional<int64_t> output_size
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4226,10 +4645,10 @@ Tensor lowerToNextLayer<batch_rule_187_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['repeat_interleave.self_int']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_188_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_202_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_188_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>>(
-  batch_rule_188_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_202_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>>(
+  batch_rule_202_t batch_rule,
   const Tensor & self, int64_t repeats, c10::optional<int64_t> dim, c10::optional<int64_t> output_size
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4244,10 +4663,10 @@ Tensor lowerToNextLayer<batch_rule_188_t,Tensor,const Tensor &, int64_t, c10::op
 }
 
 // ['rrelu']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_189_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, bool, c10::optional<Generator>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_203_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, bool, c10::optional<Generator>);
 template <>
-Tensor lowerToNextLayer<batch_rule_189_t,Tensor,const Tensor &, const Scalar &, const Scalar &, bool, c10::optional<Generator>>(
-  batch_rule_189_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_203_t,Tensor,const Tensor &, const Scalar &, const Scalar &, bool, c10::optional<Generator>>(
+  batch_rule_203_t batch_rule,
   const Tensor & self, const Scalar & lower, const Scalar & upper, bool training, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4262,10 +4681,10 @@ Tensor lowerToNextLayer<batch_rule_189_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['select.Dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_190_t)(const Tensor &, c10::optional<int64_t>, Dimname, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_204_t)(const Tensor &, c10::optional<int64_t>, Dimname, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_190_t,Tensor,const Tensor &, Dimname, int64_t>(
-  batch_rule_190_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_204_t,Tensor,const Tensor &, Dimname, int64_t>(
+  batch_rule_204_t batch_rule,
   const Tensor & self, Dimname dim, int64_t index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4280,10 +4699,10 @@ Tensor lowerToNextLayer<batch_rule_190_t,Tensor,const Tensor &, Dimname, int64_t
 }
 
 // ['logit', 'special_logit']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_191_t)(const Tensor &, c10::optional<int64_t>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_205_t)(const Tensor &, c10::optional<int64_t>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_191_t,Tensor,const Tensor &, c10::optional<double>>(
-  batch_rule_191_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_205_t,Tensor,const Tensor &, c10::optional<double>>(
+  batch_rule_205_t batch_rule,
   const Tensor & self, c10::optional<double> eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4298,10 +4717,10 @@ Tensor lowerToNextLayer<batch_rule_191_t,Tensor,const Tensor &, c10::optional<do
 }
 
 // ['size.int', 'stride.int']
-typedef std::tuple<int64_t> (*batch_rule_192_t)(const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<int64_t> (*batch_rule_206_t)(const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-int64_t lowerToNextLayer<batch_rule_192_t,int64_t,const Tensor &, int64_t>(
-  batch_rule_192_t batch_rule,
+int64_t lowerToNextLayer<batch_rule_206_t,int64_t,const Tensor &, int64_t>(
+  batch_rule_206_t batch_rule,
   const Tensor & self, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4316,10 +4735,10 @@ int64_t lowerToNextLayer<batch_rule_192_t,int64_t,const Tensor &, int64_t>(
 }
 
 // ['size.Dimname', 'stride.Dimname']
-typedef std::tuple<int64_t> (*batch_rule_193_t)(const Tensor &, c10::optional<int64_t>, Dimname);
+typedef std::tuple<int64_t> (*batch_rule_207_t)(const Tensor &, c10::optional<int64_t>, Dimname);
 template <>
-int64_t lowerToNextLayer<batch_rule_193_t,int64_t,const Tensor &, Dimname>(
-  batch_rule_193_t batch_rule,
+int64_t lowerToNextLayer<batch_rule_207_t,int64_t,const Tensor &, Dimname>(
+  batch_rule_207_t batch_rule,
   const Tensor & self, Dimname dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4334,10 +4753,10 @@ int64_t lowerToNextLayer<batch_rule_193_t,int64_t,const Tensor &, Dimname>(
 }
 
 // ['slice.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_194_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_208_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_194_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t>(
-  batch_rule_194_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_208_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t>(
+  batch_rule_208_t batch_rule,
   const Tensor & self, int64_t dim, c10::optional<int64_t> start, c10::optional<int64_t> end, int64_t step
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4352,10 +4771,10 @@ Tensor lowerToNextLayer<batch_rule_194_t,Tensor,const Tensor &, int64_t, c10::op
 }
 
 // ['slice_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_195_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_209_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_195_t,Tensor,const Tensor &, IntArrayRef, int64_t, int64_t, int64_t, int64_t>(
-  batch_rule_195_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_209_t,Tensor,const Tensor &, IntArrayRef, int64_t, int64_t, int64_t, int64_t>(
+  batch_rule_209_t batch_rule,
   const Tensor & grad_output, IntArrayRef input_sizes, int64_t dim, int64_t start, int64_t end, int64_t step
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4370,10 +4789,10 @@ Tensor lowerToNextLayer<batch_rule_195_t,Tensor,const Tensor &, IntArrayRef, int
 }
 
 // ['slice_scatter']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_196_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_210_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_196_t,Tensor,const Tensor &, const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t>(
-  batch_rule_196_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_210_t,Tensor,const Tensor &, const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, int64_t>(
+  batch_rule_210_t batch_rule,
   const Tensor & self, const Tensor & src, int64_t dim, c10::optional<int64_t> start, c10::optional<int64_t> end, int64_t step
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4391,10 +4810,10 @@ Tensor lowerToNextLayer<batch_rule_196_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['select_scatter']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_197_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_211_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_197_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t>(
-  batch_rule_197_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_211_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t>(
+  batch_rule_211_t batch_rule,
   const Tensor & self, const Tensor & src, int64_t dim, int64_t index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4412,10 +4831,10 @@ Tensor lowerToNextLayer<batch_rule_197_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['diagonal_scatter']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_198_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_212_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_198_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t, int64_t>(
-  batch_rule_198_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_212_t,Tensor,const Tensor &, const Tensor &, int64_t, int64_t, int64_t>(
+  batch_rule_212_t batch_rule,
   const Tensor & self, const Tensor & src, int64_t offset, int64_t dim1, int64_t dim2
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4433,10 +4852,10 @@ Tensor lowerToNextLayer<batch_rule_198_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['hsplit.int', 'vsplit.int', 'dsplit.int', 'unbind.int']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_199_t)(const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_213_t)(const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_199_t,::std::vector<Tensor>,const Tensor &, int64_t>(
-  batch_rule_199_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_213_t,::std::vector<Tensor>,const Tensor &, int64_t>(
+  batch_rule_213_t batch_rule,
   const Tensor & self, int64_t sections
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4451,10 +4870,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_199_t,::std::vector<Tensor>,co
 }
 
 // ['hsplit.array', 'vsplit.array', 'dsplit.array']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_200_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_214_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_200_t,::std::vector<Tensor>,const Tensor &, IntArrayRef>(
-  batch_rule_200_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_214_t,::std::vector<Tensor>,const Tensor &, IntArrayRef>(
+  batch_rule_214_t batch_rule,
   const Tensor & self, IntArrayRef indices
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4469,10 +4888,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_200_t,::std::vector<Tensor>,co
 }
 
 // ['stft']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_201_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, c10::optional<bool>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_215_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, c10::optional<bool>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_201_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, bool, c10::optional<bool>, c10::optional<bool>>(
-  batch_rule_201_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_215_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, bool, c10::optional<bool>, c10::optional<bool>>(
+  batch_rule_215_t batch_rule,
   const Tensor & self, int64_t n_fft, c10::optional<int64_t> hop_length, c10::optional<int64_t> win_length, const c10::optional<Tensor> & window, bool normalized, c10::optional<bool> onesided, c10::optional<bool> return_complex
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4492,10 +4911,10 @@ Tensor lowerToNextLayer<batch_rule_201_t,Tensor,const Tensor &, int64_t, c10::op
 }
 
 // ['istft']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_202_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, bool, c10::optional<bool>, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_216_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool, bool, c10::optional<bool>, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_202_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, bool, bool, c10::optional<bool>, c10::optional<int64_t>, bool>(
-  batch_rule_202_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_216_t,Tensor,const Tensor &, int64_t, c10::optional<int64_t>, c10::optional<int64_t>, const c10::optional<Tensor> &, bool, bool, c10::optional<bool>, c10::optional<int64_t>, bool>(
+  batch_rule_216_t batch_rule,
   const Tensor & self, int64_t n_fft, c10::optional<int64_t> hop_length, c10::optional<int64_t> win_length, const c10::optional<Tensor> & window, bool center, bool normalized, c10::optional<bool> onesided, c10::optional<int64_t> length, bool return_complex
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4515,10 +4934,10 @@ Tensor lowerToNextLayer<batch_rule_202_t,Tensor,const Tensor &, int64_t, c10::op
 }
 
 // ['std.dim', 'var.dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_203_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_217_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_203_t,Tensor,const Tensor &, IntArrayRef, bool, bool>(
-  batch_rule_203_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_217_t,Tensor,const Tensor &, IntArrayRef, bool, bool>(
+  batch_rule_217_t batch_rule,
   const Tensor & self, IntArrayRef dim, bool unbiased, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4533,10 +4952,10 @@ Tensor lowerToNextLayer<batch_rule_203_t,Tensor,const Tensor &, IntArrayRef, boo
 }
 
 // ['std.correction', 'var.correction']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_204_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_218_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_204_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool>(
-  batch_rule_204_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_218_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool>(
+  batch_rule_218_t batch_rule,
   const Tensor & self, c10::optional<IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4550,11 +4969,11 @@ Tensor lowerToNextLayer<batch_rule_204_t,Tensor,const Tensor &, c10::optional<In
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
-// ['std_mean', 'var_mean', 'eig', 'qr', 'linalg_lu_factor', 'linalg_inv_ex']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_205_t)(const Tensor &, c10::optional<int64_t>, bool);
+// ['std_mean', 'var_mean', 'eig', 'qr', 'linalg_inv_ex']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_219_t)(const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_205_t,std::tuple<Tensor,Tensor>,const Tensor &, bool>(
-  batch_rule_205_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_219_t,std::tuple<Tensor,Tensor>,const Tensor &, bool>(
+  batch_rule_219_t batch_rule,
   const Tensor & self, bool unbiased
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4569,10 +4988,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_205_t,std::tuple<Tensor,Te
 }
 
 // ['std_mean.dim', 'var_mean.dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_206_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_220_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_206_t,std::tuple<Tensor,Tensor>,const Tensor &, IntArrayRef, bool, bool>(
-  batch_rule_206_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_220_t,std::tuple<Tensor,Tensor>,const Tensor &, IntArrayRef, bool, bool>(
+  batch_rule_220_t batch_rule,
   const Tensor & self, IntArrayRef dim, bool unbiased, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4587,10 +5006,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_206_t,std::tuple<Tensor,Te
 }
 
 // ['std_mean.correction', 'var_mean.correction']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_207_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_221_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_207_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool>(
-  batch_rule_207_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_221_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<IntArrayRef>, c10::optional<int64_t>, bool>(
+  batch_rule_221_t batch_rule,
   const Tensor & self, c10::optional<IntArrayRef> dim, c10::optional<int64_t> correction, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4605,10 +5024,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_207_t,std::tuple<Tensor,Te
 }
 
 // ['std_mean.names_dim', 'var_mean.names_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_208_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_222_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_208_t,std::tuple<Tensor,Tensor>,const Tensor &, DimnameList, bool, bool>(
-  batch_rule_208_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_222_t,std::tuple<Tensor,Tensor>,const Tensor &, DimnameList, bool, bool>(
+  batch_rule_222_t batch_rule,
   const Tensor & self, DimnameList dim, bool unbiased, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4623,10 +5042,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_208_t,std::tuple<Tensor,Te
 }
 
 // ['std_mean.correction_names', 'var_mean.correction_names']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_209_t)(const Tensor &, c10::optional<int64_t>, DimnameList, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_223_t)(const Tensor &, c10::optional<int64_t>, DimnameList, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_209_t,std::tuple<Tensor,Tensor>,const Tensor &, DimnameList, c10::optional<int64_t>, bool>(
-  batch_rule_209_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_223_t,std::tuple<Tensor,Tensor>,const Tensor &, DimnameList, c10::optional<int64_t>, bool>(
+  batch_rule_223_t batch_rule,
   const Tensor & self, DimnameList dim, c10::optional<int64_t> correction, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4641,10 +5060,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_209_t,std::tuple<Tensor,Te
 }
 
 // ['std.names_dim', 'var.names_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_210_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_224_t)(const Tensor &, c10::optional<int64_t>, DimnameList, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_210_t,Tensor,const Tensor &, DimnameList, bool, bool>(
-  batch_rule_210_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_224_t,Tensor,const Tensor &, DimnameList, bool, bool>(
+  batch_rule_224_t batch_rule,
   const Tensor & self, DimnameList dim, bool unbiased, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4659,10 +5078,10 @@ Tensor lowerToNextLayer<batch_rule_210_t,Tensor,const Tensor &, DimnameList, boo
 }
 
 // ['std.correction_names', 'var.correction_names']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_211_t)(const Tensor &, c10::optional<int64_t>, DimnameList, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_225_t)(const Tensor &, c10::optional<int64_t>, DimnameList, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_211_t,Tensor,const Tensor &, DimnameList, c10::optional<int64_t>, bool>(
-  batch_rule_211_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_225_t,Tensor,const Tensor &, DimnameList, c10::optional<int64_t>, bool>(
+  batch_rule_225_t batch_rule,
   const Tensor & self, DimnameList dim, c10::optional<int64_t> correction, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4677,10 +5096,10 @@ Tensor lowerToNextLayer<batch_rule_211_t,Tensor,const Tensor &, DimnameList, c10
 }
 
 // ['prod.dim_int']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_212_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_226_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_212_t,Tensor,const Tensor &, int64_t, bool, c10::optional<ScalarType>>(
-  batch_rule_212_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_226_t,Tensor,const Tensor &, int64_t, bool, c10::optional<ScalarType>>(
+  batch_rule_226_t batch_rule,
   const Tensor & self, int64_t dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4695,10 +5114,10 @@ Tensor lowerToNextLayer<batch_rule_212_t,Tensor,const Tensor &, int64_t, bool, c
 }
 
 // ['prod.dim_Dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_213_t)(const Tensor &, c10::optional<int64_t>, Dimname, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_227_t)(const Tensor &, c10::optional<int64_t>, Dimname, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_213_t,Tensor,const Tensor &, Dimname, bool, c10::optional<ScalarType>>(
-  batch_rule_213_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_227_t,Tensor,const Tensor &, Dimname, bool, c10::optional<ScalarType>>(
+  batch_rule_227_t batch_rule,
   const Tensor & self, Dimname dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4713,10 +5132,10 @@ Tensor lowerToNextLayer<batch_rule_213_t,Tensor,const Tensor &, Dimname, bool, c
 }
 
 // ['tensordot']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_214_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_228_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_214_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef>(
-  batch_rule_214_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_228_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef>(
+  batch_rule_228_t batch_rule,
   const Tensor & self, const Tensor & other, IntArrayRef dims_self, IntArrayRef dims_other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4734,10 +5153,10 @@ Tensor lowerToNextLayer<batch_rule_214_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['transpose.Dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_215_t)(const Tensor &, c10::optional<int64_t>, Dimname, Dimname);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_229_t)(const Tensor &, c10::optional<int64_t>, Dimname, Dimname);
 template <>
-Tensor lowerToNextLayer<batch_rule_215_t,Tensor,const Tensor &, Dimname, Dimname>(
-  batch_rule_215_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_229_t,Tensor,const Tensor &, Dimname, Dimname>(
+  batch_rule_229_t batch_rule,
   const Tensor & self, Dimname dim0, Dimname dim1
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4752,10 +5171,10 @@ Tensor lowerToNextLayer<batch_rule_215_t,Tensor,const Tensor &, Dimname, Dimname
 }
 
 // ['rot90']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_216_t)(const Tensor &, c10::optional<int64_t>, int64_t, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_230_t)(const Tensor &, c10::optional<int64_t>, int64_t, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_216_t,Tensor,const Tensor &, int64_t, IntArrayRef>(
-  batch_rule_216_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_230_t,Tensor,const Tensor &, int64_t, IntArrayRef>(
+  batch_rule_230_t batch_rule,
   const Tensor & self, int64_t k, IntArrayRef dims
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4770,10 +5189,10 @@ Tensor lowerToNextLayer<batch_rule_216_t,Tensor,const Tensor &, int64_t, IntArra
 }
 
 // ['trapz.dx', '_make_per_tensor_quantized_tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_217_t)(const Tensor &, c10::optional<int64_t>, double, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_231_t)(const Tensor &, c10::optional<int64_t>, double, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_217_t,Tensor,const Tensor &, double, int64_t>(
-  batch_rule_217_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_231_t,Tensor,const Tensor &, double, int64_t>(
+  batch_rule_231_t batch_rule,
   const Tensor & y, double dx, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4788,10 +5207,10 @@ Tensor lowerToNextLayer<batch_rule_217_t,Tensor,const Tensor &, double, int64_t>
 }
 
 // ['_trilinear']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_218_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_232_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_218_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
-  batch_rule_218_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_232_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
+  batch_rule_232_t batch_rule,
   const Tensor & i1, const Tensor & i2, const Tensor & i3, IntArrayRef expand1, IntArrayRef expand2, IntArrayRef expand3, IntArrayRef sumdim, int64_t unroll_dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4812,10 +5231,10 @@ Tensor lowerToNextLayer<batch_rule_218_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['triplet_margin_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_219_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, double, double, bool, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_233_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, double, double, double, bool, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_219_t,Tensor,const Tensor &, const Tensor &, const Tensor &, double, double, double, bool, int64_t>(
-  batch_rule_219_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_233_t,Tensor,const Tensor &, const Tensor &, const Tensor &, double, double, double, bool, int64_t>(
+  batch_rule_233_t batch_rule,
   const Tensor & anchor, const Tensor & positive, const Tensor & negative, double margin, double p, double eps, bool swap, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4836,10 +5255,10 @@ Tensor lowerToNextLayer<batch_rule_219_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_unique', 'symeig', '_symeig_helper', 'linalg_cholesky_ex']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_220_t)(const Tensor &, c10::optional<int64_t>, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_234_t)(const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_220_t,std::tuple<Tensor,Tensor>,const Tensor &, bool, bool>(
-  batch_rule_220_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_234_t,std::tuple<Tensor,Tensor>,const Tensor &, bool, bool>(
+  batch_rule_234_t batch_rule,
   const Tensor & self, bool sorted, bool return_inverse
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4854,10 +5273,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_220_t,std::tuple<Tensor,Te
 }
 
 // ['unique_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_221_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_235_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, bool, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_221_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, int64_t, bool, bool, bool>(
-  batch_rule_221_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_235_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, int64_t, bool, bool, bool>(
+  batch_rule_235_t batch_rule,
   const Tensor & self, int64_t dim, bool sorted, bool return_inverse, bool return_counts
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4872,10 +5291,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_221_t,std::tuple<Te
 }
 
 // ['unique_consecutive']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_222_t)(const Tensor &, c10::optional<int64_t>, bool, bool, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_236_t)(const Tensor &, c10::optional<int64_t>, bool, bool, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_222_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool, bool, c10::optional<int64_t>>(
-  batch_rule_222_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_236_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool, bool, c10::optional<int64_t>>(
+  batch_rule_236_t batch_rule,
   const Tensor & self, bool return_inverse, bool return_counts, c10::optional<int64_t> dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4890,10 +5309,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_222_t,std::tuple<Te
 }
 
 // ['unique_dim_consecutive']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_223_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_237_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_223_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, int64_t, bool, bool>(
-  batch_rule_223_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_237_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, int64_t, bool, bool>(
+  batch_rule_237_t batch_rule,
   const Tensor & self, int64_t dim, bool return_inverse, bool return_counts
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4908,10 +5327,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_223_t,std::tuple<Te
 }
 
 // ['_unique2']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_224_t)(const Tensor &, c10::optional<int64_t>, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_238_t)(const Tensor &, c10::optional<int64_t>, bool, bool, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_224_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool, bool, bool>(
-  batch_rule_224_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_238_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool, bool, bool>(
+  batch_rule_238_t batch_rule,
   const Tensor & self, bool sorted, bool return_inverse, bool return_counts
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4926,10 +5345,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_224_t,std::tuple<Te
 }
 
 // ['where.ScalarSelf']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_225_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_239_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_225_t,Tensor,const Tensor &, const Scalar &, const Tensor &>(
-  batch_rule_225_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_239_t,Tensor,const Tensor &, const Scalar &, const Tensor &>(
+  batch_rule_239_t batch_rule,
   const Tensor & condition, const Scalar & self, const Tensor & other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4947,10 +5366,10 @@ Tensor lowerToNextLayer<batch_rule_225_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['where', 'nonzero_numpy']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_226_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_240_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_226_t,::std::vector<Tensor>,const Tensor &>(
-  batch_rule_226_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_240_t,::std::vector<Tensor>,const Tensor &>(
+  batch_rule_240_t batch_rule,
   const Tensor & condition
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4965,10 +5384,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_226_t,::std::vector<Tensor>,co
 }
 
 // ['_weight_norm_cuda_interface', 'multilabel_margin_loss_forward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_227_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_241_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_227_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, int64_t>(
-  batch_rule_227_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_241_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, int64_t>(
+  batch_rule_241_t batch_rule,
   const Tensor & v, const Tensor & g, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -4986,10 +5405,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_227_t,std::tuple<Tensor,Te
 }
 
 // ['_weight_norm_cuda_interface_backward', '_weight_norm_differentiable_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_228_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_242_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_228_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t>(
-  batch_rule_228_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_242_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t>(
+  batch_rule_242_t batch_rule,
   const Tensor & grad_w, const Tensor & saved_v, const Tensor & saved_g, const Tensor & saved_norms, int64_t dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5013,10 +5432,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_228_t,std::tuple<Tensor,Te
 }
 
 // ['binomial', 'normal.Tensor_Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_229_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<Generator>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_243_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<Generator>);
 template <>
-Tensor lowerToNextLayer<batch_rule_229_t,Tensor,const Tensor &, const Tensor &, c10::optional<Generator>>(
-  batch_rule_229_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_243_t,Tensor,const Tensor &, const Tensor &, c10::optional<Generator>>(
+  batch_rule_243_t batch_rule,
   const Tensor & count, const Tensor & prob, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5034,10 +5453,10 @@ Tensor lowerToNextLayer<batch_rule_229_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['native_norm.ScalarOpt_dim_dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_230_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, IntArrayRef, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_244_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, IntArrayRef, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_230_t,Tensor,const Tensor &, const c10::optional<Scalar> &, IntArrayRef, bool, c10::optional<ScalarType>>(
-  batch_rule_230_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_244_t,Tensor,const Tensor &, const c10::optional<Scalar> &, IntArrayRef, bool, c10::optional<ScalarType>>(
+  batch_rule_244_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p, IntArrayRef dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5052,10 +5471,10 @@ Tensor lowerToNextLayer<batch_rule_230_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['_sparse_sum.dtype', 'view.dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_231_t)(const Tensor &, c10::optional<int64_t>, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_245_t)(const Tensor &, c10::optional<int64_t>, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_231_t,Tensor,const Tensor &, ScalarType>(
-  batch_rule_231_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_245_t,Tensor,const Tensor &, ScalarType>(
+  batch_rule_245_t batch_rule,
   const Tensor & self, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5070,10 +5489,10 @@ Tensor lowerToNextLayer<batch_rule_231_t,Tensor,const Tensor &, ScalarType>(
 }
 
 // ['_sparse_sum.dim_dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_232_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_246_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_232_t,Tensor,const Tensor &, IntArrayRef, ScalarType>(
-  batch_rule_232_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_246_t,Tensor,const Tensor &, IntArrayRef, ScalarType>(
+  batch_rule_246_t batch_rule,
   const Tensor & self, IntArrayRef dim, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5088,10 +5507,10 @@ Tensor lowerToNextLayer<batch_rule_232_t,Tensor,const Tensor &, IntArrayRef, Sca
 }
 
 // ['_sparse_sum_backward', 'max_unpool2d', 'reflection_pad1d_backward', 'reflection_pad2d_backward', 'reflection_pad3d_backward', 'replication_pad1d_backward', 'replication_pad2d_backward', 'replication_pad3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_233_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_247_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_233_t,Tensor,const Tensor &, const Tensor &, IntArrayRef>(
-  batch_rule_233_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_247_t,Tensor,const Tensor &, const Tensor &, IntArrayRef>(
+  batch_rule_247_t batch_rule,
   const Tensor & grad, const Tensor & self, IntArrayRef dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5109,10 +5528,10 @@ Tensor lowerToNextLayer<batch_rule_233_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['norm.ScalarOpt_dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_234_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_248_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_234_t,Tensor,const Tensor &, const c10::optional<Scalar> &, ScalarType>(
-  batch_rule_234_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_248_t,Tensor,const Tensor &, const c10::optional<Scalar> &, ScalarType>(
+  batch_rule_248_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5127,10 +5546,10 @@ Tensor lowerToNextLayer<batch_rule_234_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['norm.ScalarOpt_dim_dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_235_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, IntArrayRef, bool, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_249_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, IntArrayRef, bool, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_235_t,Tensor,const Tensor &, const c10::optional<Scalar> &, IntArrayRef, bool, ScalarType>(
-  batch_rule_235_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_249_t,Tensor,const Tensor &, const c10::optional<Scalar> &, IntArrayRef, bool, ScalarType>(
+  batch_rule_249_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p, IntArrayRef dim, bool keepdim, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5145,10 +5564,10 @@ Tensor lowerToNextLayer<batch_rule_235_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['norm.ScalarOpt_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_236_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, IntArrayRef, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_250_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, IntArrayRef, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_236_t,Tensor,const Tensor &, const c10::optional<Scalar> &, IntArrayRef, bool>(
-  batch_rule_236_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_250_t,Tensor,const Tensor &, const c10::optional<Scalar> &, IntArrayRef, bool>(
+  batch_rule_250_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p, IntArrayRef dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5163,10 +5582,10 @@ Tensor lowerToNextLayer<batch_rule_236_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['norm.names_ScalarOpt_dim_dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_237_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, DimnameList, bool, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_251_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, DimnameList, bool, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_237_t,Tensor,const Tensor &, const c10::optional<Scalar> &, DimnameList, bool, ScalarType>(
-  batch_rule_237_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_251_t,Tensor,const Tensor &, const c10::optional<Scalar> &, DimnameList, bool, ScalarType>(
+  batch_rule_251_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p, DimnameList dim, bool keepdim, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5181,10 +5600,10 @@ Tensor lowerToNextLayer<batch_rule_237_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['norm.names_ScalarOpt_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_238_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, DimnameList, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_252_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, DimnameList, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_238_t,Tensor,const Tensor &, const c10::optional<Scalar> &, DimnameList, bool>(
-  batch_rule_238_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_252_t,Tensor,const Tensor &, const c10::optional<Scalar> &, DimnameList, bool>(
+  batch_rule_252_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p, DimnameList dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5199,10 +5618,10 @@ Tensor lowerToNextLayer<batch_rule_238_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['clone']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_239_t)(const Tensor &, c10::optional<int64_t>, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_253_t)(const Tensor &, c10::optional<int64_t>, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_239_t,Tensor,const Tensor &, c10::optional<MemoryFormat>>(
-  batch_rule_239_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_253_t,Tensor,const Tensor &, c10::optional<MemoryFormat>>(
+  batch_rule_253_t batch_rule,
   const Tensor & self, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5217,10 +5636,10 @@ Tensor lowerToNextLayer<batch_rule_239_t,Tensor,const Tensor &, c10::optional<Me
 }
 
 // ['sparse_csr_tensor.crow_col_value_size', '_sparse_csr_tensor_unsafe']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_240_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_254_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_240_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_240_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_254_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_254_t batch_rule,
   const Tensor & crow_indices, const Tensor & col_indices, const Tensor & values, IntArrayRef size, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5241,10 +5660,10 @@ Tensor lowerToNextLayer<batch_rule_240_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['sparse_csr_tensor.crow_col_value']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_241_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_255_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_241_t,Tensor,const Tensor &, const Tensor &, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_241_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_255_t,Tensor,const Tensor &, const Tensor &, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_255_t batch_rule,
   const Tensor & crow_indices, const Tensor & col_indices, const Tensor & values, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5265,10 +5684,10 @@ Tensor lowerToNextLayer<batch_rule_241_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['sparse_coo_tensor.indices']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_242_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_256_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_242_t,Tensor,const Tensor &, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_242_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_256_t,Tensor,const Tensor &, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_256_t batch_rule,
   const Tensor & indices, const Tensor & values, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5286,10 +5705,10 @@ Tensor lowerToNextLayer<batch_rule_242_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['sparse_coo_tensor.indices_size', '_sparse_coo_tensor_unsafe']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_243_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_257_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_243_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_243_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_257_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_257_t batch_rule,
   const Tensor & indices, const Tensor & values, IntArrayRef size, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5307,10 +5726,10 @@ Tensor lowerToNextLayer<batch_rule_243_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_sparse_coo_tensor_with_dims_and_tensors']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_244_t)(int64_t, int64_t, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_258_t)(int64_t, int64_t, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>);
 template <>
-Tensor lowerToNextLayer<batch_rule_244_t,Tensor,int64_t, int64_t, IntArrayRef, const Tensor &, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
-  batch_rule_244_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_258_t,Tensor,int64_t, int64_t, IntArrayRef, const Tensor &, const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>>(
+  batch_rule_258_t batch_rule,
   int64_t sparse_dim, int64_t dense_dim, IntArrayRef size, const Tensor & indices, const Tensor & values, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5328,10 +5747,10 @@ Tensor lowerToNextLayer<batch_rule_244_t,Tensor,int64_t, int64_t, IntArrayRef, c
 }
 
 // ['unbind.Dimname']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_245_t)(const Tensor &, c10::optional<int64_t>, Dimname);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_259_t)(const Tensor &, c10::optional<int64_t>, Dimname);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_245_t,::std::vector<Tensor>,const Tensor &, Dimname>(
-  batch_rule_245_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_259_t,::std::vector<Tensor>,const Tensor &, Dimname>(
+  batch_rule_259_t batch_rule,
   const Tensor & self, Dimname dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5346,10 +5765,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_245_t,::std::vector<Tensor>,co
 }
 
 // ['mkldnn_reorder_conv2d_weight', 'mkldnn_reorder_conv3d_weight']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_246_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_260_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_246_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
-  batch_rule_246_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_260_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, int64_t>(
+  batch_rule_260_t batch_rule,
   const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5364,10 +5783,10 @@ Tensor lowerToNextLayer<batch_rule_246_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['quantize_per_tensor_dynamic']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_247_t)(const Tensor &, c10::optional<int64_t>, ScalarType, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_261_t)(const Tensor &, c10::optional<int64_t>, ScalarType, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_247_t,Tensor,const Tensor &, ScalarType, bool>(
-  batch_rule_247_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_261_t,Tensor,const Tensor &, ScalarType, bool>(
+  batch_rule_261_t batch_rule,
   const Tensor & self, ScalarType dtype, bool reduce_range
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5382,10 +5801,10 @@ Tensor lowerToNextLayer<batch_rule_247_t,Tensor,const Tensor &, ScalarType, bool
 }
 
 // ['quantize_per_tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_248_t)(const Tensor &, c10::optional<int64_t>, double, int64_t, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_262_t)(const Tensor &, c10::optional<int64_t>, double, int64_t, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_248_t,Tensor,const Tensor &, double, int64_t, ScalarType>(
-  batch_rule_248_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_262_t,Tensor,const Tensor &, double, int64_t, ScalarType>(
+  batch_rule_262_t batch_rule,
   const Tensor & self, double scale, int64_t zero_point, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5400,10 +5819,10 @@ Tensor lowerToNextLayer<batch_rule_248_t,Tensor,const Tensor &, double, int64_t,
 }
 
 // ['quantize_per_tensor.tensor_qparams']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_249_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_263_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_249_t,Tensor,const Tensor &, const Tensor &, const Tensor &, ScalarType>(
-  batch_rule_249_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_263_t,Tensor,const Tensor &, const Tensor &, const Tensor &, ScalarType>(
+  batch_rule_263_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5424,10 +5843,10 @@ Tensor lowerToNextLayer<batch_rule_249_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['quantize_per_channel']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_250_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_264_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_250_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, ScalarType>(
-  batch_rule_250_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_264_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, ScalarType>(
+  batch_rule_264_t batch_rule,
   const Tensor & self, const Tensor & scales, const Tensor & zero_points, int64_t axis, ScalarType dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5448,10 +5867,10 @@ Tensor lowerToNextLayer<batch_rule_250_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['q_scale']
-typedef std::tuple<double> (*batch_rule_251_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<double> (*batch_rule_265_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-double lowerToNextLayer<batch_rule_251_t,double,const Tensor &>(
-  batch_rule_251_t batch_rule,
+double lowerToNextLayer<batch_rule_265_t,double,const Tensor &>(
+  batch_rule_265_t batch_rule,
   const Tensor & self
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5466,10 +5885,10 @@ double lowerToNextLayer<batch_rule_251_t,double,const Tensor &>(
 }
 
 // ['qscheme']
-typedef std::tuple<QScheme> (*batch_rule_252_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<QScheme> (*batch_rule_266_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-QScheme lowerToNextLayer<batch_rule_252_t,QScheme,const Tensor &>(
-  batch_rule_252_t batch_rule,
+QScheme lowerToNextLayer<batch_rule_266_t,QScheme,const Tensor &>(
+  batch_rule_266_t batch_rule,
   const Tensor & self
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5484,10 +5903,10 @@ QScheme lowerToNextLayer<batch_rule_252_t,QScheme,const Tensor &>(
 }
 
 // ['fake_quantize_per_tensor_affine']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_253_t)(const Tensor &, c10::optional<int64_t>, double, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_267_t)(const Tensor &, c10::optional<int64_t>, double, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_253_t,Tensor,const Tensor &, double, int64_t, int64_t, int64_t>(
-  batch_rule_253_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_267_t,Tensor,const Tensor &, double, int64_t, int64_t, int64_t>(
+  batch_rule_267_t batch_rule,
   const Tensor & self, double scale, int64_t zero_point, int64_t quant_min, int64_t quant_max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5502,10 +5921,10 @@ Tensor lowerToNextLayer<batch_rule_253_t,Tensor,const Tensor &, double, int64_t,
 }
 
 // ['fake_quantize_per_tensor_affine.tensor_qparams']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_254_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_268_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_254_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t>(
-  batch_rule_254_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_268_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t>(
+  batch_rule_268_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t quant_min, int64_t quant_max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5526,10 +5945,10 @@ Tensor lowerToNextLayer<batch_rule_254_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['fake_quantize_per_tensor_affine_cachemask']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_255_t)(const Tensor &, c10::optional<int64_t>, double, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_269_t)(const Tensor &, c10::optional<int64_t>, double, int64_t, int64_t, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_255_t,std::tuple<Tensor,Tensor>,const Tensor &, double, int64_t, int64_t, int64_t>(
-  batch_rule_255_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_269_t,std::tuple<Tensor,Tensor>,const Tensor &, double, int64_t, int64_t, int64_t>(
+  batch_rule_269_t batch_rule,
   const Tensor & self, double scale, int64_t zero_point, int64_t quant_min, int64_t quant_max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5544,10 +5963,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_255_t,std::tuple<Tensor,Te
 }
 
 // ['_fake_quantize_per_tensor_affine_cachemask_tensor_qparams']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_256_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_270_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_256_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t>(
-  batch_rule_256_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_270_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t>(
+  batch_rule_270_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, const Tensor & fake_quant_enabled, int64_t quant_min, int64_t quant_max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5571,10 +5990,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_256_t,std::tuple<Tensor,Te
 }
 
 // ['_fake_quantize_learnable_per_tensor_affine']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_257_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_271_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_257_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, double>(
-  batch_rule_257_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_271_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, double>(
+  batch_rule_271_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t quant_min, int64_t quant_max, double grad_factor
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5595,10 +6014,10 @@ Tensor lowerToNextLayer<batch_rule_257_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_fake_quantize_learnable_per_tensor_affine_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_258_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_272_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_258_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, double>(
-  batch_rule_258_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_272_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, double>(
+  batch_rule_272_t batch_rule,
   const Tensor & grad, const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t quant_min, int64_t quant_max, double grad_factor
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5622,10 +6041,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_258_t,std::tuple<Te
 }
 
 // ['fake_quantize_per_channel_affine']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_259_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_273_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_259_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t>(
-  batch_rule_259_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_273_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t>(
+  batch_rule_273_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t axis, int64_t quant_min, int64_t quant_max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5646,10 +6065,10 @@ Tensor lowerToNextLayer<batch_rule_259_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['fake_quantize_per_channel_affine_cachemask']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_260_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_274_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_260_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t>(
-  batch_rule_260_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_274_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t>(
+  batch_rule_274_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t axis, int64_t quant_min, int64_t quant_max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5670,10 +6089,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_260_t,std::tuple<Tensor,Te
 }
 
 // ['_fake_quantize_learnable_per_channel_affine']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_261_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_275_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_261_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t, double>(
-  batch_rule_261_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_275_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t, double>(
+  batch_rule_275_t batch_rule,
   const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t axis, int64_t quant_min, int64_t quant_max, double grad_factor
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5694,10 +6113,10 @@ Tensor lowerToNextLayer<batch_rule_261_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_fake_quantize_learnable_per_channel_affine_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_262_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_276_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, int64_t, int64_t, double);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_262_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t, double>(
-  batch_rule_262_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_276_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, int64_t, int64_t, int64_t, double>(
+  batch_rule_276_t batch_rule,
   const Tensor & grad, const Tensor & self, const Tensor & scale, const Tensor & zero_point, int64_t axis, int64_t quant_min, int64_t quant_max, double grad_factor
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5721,10 +6140,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_262_t,std::tuple<Te
 }
 
 // ['_choose_qparams_per_tensor']
-typedef std::tuple<double,int64_t> (*batch_rule_263_t)(const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<double,int64_t> (*batch_rule_277_t)(const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<double,int64_t> lowerToNextLayer<batch_rule_263_t,std::tuple<double,int64_t>,const Tensor &, bool>(
-  batch_rule_263_t batch_rule,
+std::tuple<double,int64_t> lowerToNextLayer<batch_rule_277_t,std::tuple<double,int64_t>,const Tensor &, bool>(
+  batch_rule_277_t batch_rule,
   const Tensor & self, bool reduce_range
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5739,10 +6158,10 @@ std::tuple<double,int64_t> lowerToNextLayer<batch_rule_263_t,std::tuple<double,i
 }
 
 // ['choose_qparams_optimized']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_264_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, double, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_278_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, double, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_264_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, int64_t, double, int64_t>(
-  batch_rule_264_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_278_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, int64_t, double, int64_t>(
+  batch_rule_278_t batch_rule,
   const Tensor & input, int64_t numel, int64_t n_bins, double ratio, int64_t bit_width
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5757,10 +6176,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_264_t,std::tuple<Tensor,Te
 }
 
 // ['_autocast_to_reduced_precision']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_265_t)(const Tensor &, c10::optional<int64_t>, bool, bool, ScalarType, ScalarType);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_279_t)(const Tensor &, c10::optional<int64_t>, bool, bool, ScalarType, ScalarType);
 template <>
-Tensor lowerToNextLayer<batch_rule_265_t,Tensor,const Tensor &, bool, bool, ScalarType, ScalarType>(
-  batch_rule_265_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_279_t,Tensor,const Tensor &, bool, bool, ScalarType, ScalarType>(
+  batch_rule_279_t batch_rule,
   const Tensor & self, bool cuda_enabled, bool cpu_enabled, ScalarType cuda_dtype, ScalarType cpu_dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5775,10 +6194,10 @@ Tensor lowerToNextLayer<batch_rule_265_t,Tensor,const Tensor &, bool, bool, Scal
 }
 
 // ['_autocast_to_full_precision']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_266_t)(const Tensor &, c10::optional<int64_t>, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_280_t)(const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_266_t,Tensor,const Tensor &, bool, bool>(
-  batch_rule_266_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_280_t,Tensor,const Tensor &, bool, bool>(
+  batch_rule_280_t batch_rule,
   const Tensor & self, bool cuda_enabled, bool cpu_enabled
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5793,10 +6212,10 @@ Tensor lowerToNextLayer<batch_rule_266_t,Tensor,const Tensor &, bool, bool>(
 }
 
 // ['_to_copy']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_267_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_281_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_267_t,Tensor,const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, c10::optional<MemoryFormat>>(
-  batch_rule_267_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_281_t,Tensor,const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, c10::optional<MemoryFormat>>(
+  batch_rule_281_t batch_rule,
   const Tensor & self, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, bool non_blocking, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5811,10 +6230,10 @@ Tensor lowerToNextLayer<batch_rule_267_t,Tensor,const Tensor &, c10::optional<Sc
 }
 
 // ['to.dtype_layout']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_268_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, bool, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_282_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, bool, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_268_t,Tensor,const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, bool, c10::optional<MemoryFormat>>(
-  batch_rule_268_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_282_t,Tensor,const Tensor &, c10::optional<ScalarType>, c10::optional<Layout>, c10::optional<Device>, c10::optional<bool>, bool, bool, c10::optional<MemoryFormat>>(
+  batch_rule_282_t batch_rule,
   const Tensor & self, c10::optional<ScalarType> dtype, c10::optional<Layout> layout, c10::optional<Device> device, c10::optional<bool> pin_memory, bool non_blocking, bool copy, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5829,10 +6248,10 @@ Tensor lowerToNextLayer<batch_rule_268_t,Tensor,const Tensor &, c10::optional<Sc
 }
 
 // ['to.device']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_269_t)(const Tensor &, c10::optional<int64_t>, Device, ScalarType, bool, bool, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_283_t)(const Tensor &, c10::optional<int64_t>, Device, ScalarType, bool, bool, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_269_t,Tensor,const Tensor &, Device, ScalarType, bool, bool, c10::optional<MemoryFormat>>(
-  batch_rule_269_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_283_t,Tensor,const Tensor &, Device, ScalarType, bool, bool, c10::optional<MemoryFormat>>(
+  batch_rule_283_t batch_rule,
   const Tensor & self, Device device, ScalarType dtype, bool non_blocking, bool copy, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5847,10 +6266,10 @@ Tensor lowerToNextLayer<batch_rule_269_t,Tensor,const Tensor &, Device, ScalarTy
 }
 
 // ['to.dtype']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_270_t)(const Tensor &, c10::optional<int64_t>, ScalarType, bool, bool, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_284_t)(const Tensor &, c10::optional<int64_t>, ScalarType, bool, bool, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_270_t,Tensor,const Tensor &, ScalarType, bool, bool, c10::optional<MemoryFormat>>(
-  batch_rule_270_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_284_t,Tensor,const Tensor &, ScalarType, bool, bool, c10::optional<MemoryFormat>>(
+  batch_rule_284_t batch_rule,
   const Tensor & self, ScalarType dtype, bool non_blocking, bool copy, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5865,10 +6284,10 @@ Tensor lowerToNextLayer<batch_rule_270_t,Tensor,const Tensor &, ScalarType, bool
 }
 
 // ['to.other']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_271_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, c10::optional<MemoryFormat>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_285_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, c10::optional<MemoryFormat>);
 template <>
-Tensor lowerToNextLayer<batch_rule_271_t,Tensor,const Tensor &, const Tensor &, bool, bool, c10::optional<MemoryFormat>>(
-  batch_rule_271_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_285_t,Tensor,const Tensor &, const Tensor &, bool, bool, c10::optional<MemoryFormat>>(
+  batch_rule_285_t batch_rule,
   const Tensor & self, const Tensor & other, bool non_blocking, bool copy, c10::optional<MemoryFormat> memory_format
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5886,10 +6305,10 @@ Tensor lowerToNextLayer<batch_rule_271_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['item', '_local_scalar_dense']
-typedef std::tuple<Scalar> (*batch_rule_272_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Scalar> (*batch_rule_286_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-Scalar lowerToNextLayer<batch_rule_272_t,Scalar,const Tensor &>(
-  batch_rule_272_t batch_rule,
+Scalar lowerToNextLayer<batch_rule_286_t,Scalar,const Tensor &>(
+  batch_rule_286_t batch_rule,
   const Tensor & self
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5904,10 +6323,10 @@ Scalar lowerToNextLayer<batch_rule_272_t,Scalar,const Tensor &>(
 }
 
 // ['result_type.Tensor']
-typedef std::tuple<ScalarType> (*batch_rule_273_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<ScalarType> (*batch_rule_287_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-ScalarType lowerToNextLayer<batch_rule_273_t,ScalarType,const Tensor &, const Tensor &>(
-  batch_rule_273_t batch_rule,
+ScalarType lowerToNextLayer<batch_rule_287_t,ScalarType,const Tensor &, const Tensor &>(
+  batch_rule_287_t batch_rule,
   const Tensor & tensor, const Tensor & other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5925,10 +6344,10 @@ ScalarType lowerToNextLayer<batch_rule_273_t,ScalarType,const Tensor &, const Te
 }
 
 // ['result_type.Scalar']
-typedef std::tuple<ScalarType> (*batch_rule_274_t)(const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<ScalarType> (*batch_rule_288_t)(const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-ScalarType lowerToNextLayer<batch_rule_274_t,ScalarType,const Tensor &, const Scalar &>(
-  batch_rule_274_t batch_rule,
+ScalarType lowerToNextLayer<batch_rule_288_t,ScalarType,const Tensor &, const Scalar &>(
+  batch_rule_288_t batch_rule,
   const Tensor & tensor, const Scalar & other
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5943,10 +6362,10 @@ ScalarType lowerToNextLayer<batch_rule_274_t,ScalarType,const Tensor &, const Sc
 }
 
 // ['result_type.Scalar_Tensor']
-typedef std::tuple<ScalarType> (*batch_rule_275_t)(const Scalar &, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<ScalarType> (*batch_rule_289_t)(const Scalar &, const Tensor &, c10::optional<int64_t>);
 template <>
-ScalarType lowerToNextLayer<batch_rule_275_t,ScalarType,const Scalar &, const Tensor &>(
-  batch_rule_275_t batch_rule,
+ScalarType lowerToNextLayer<batch_rule_289_t,ScalarType,const Scalar &, const Tensor &>(
+  batch_rule_289_t batch_rule,
   const Scalar & scalar, const Tensor & tensor
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5961,10 +6380,10 @@ ScalarType lowerToNextLayer<batch_rule_275_t,ScalarType,const Scalar &, const Te
 }
 
 // ['_thnn_fused_lstm_cell']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_276_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_290_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_276_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_276_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_290_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_290_t batch_rule,
   const Tensor & input_gates, const Tensor & hidden_gates, const Tensor & cx, const c10::optional<Tensor> & input_bias, const c10::optional<Tensor> & hidden_bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -5995,10 +6414,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_276_t,std::tuple<Te
 }
 
 // ['_thnn_fused_lstm_cell_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_277_t)(const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_291_t)(const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_277_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const Tensor &, bool>(
-  batch_rule_277_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_291_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const Tensor &, bool>(
+  batch_rule_291_t batch_rule,
   const c10::optional<Tensor> & grad_hy, const c10::optional<Tensor> & grad_cy, const Tensor & cx, const Tensor & cy, const Tensor & workspace, bool has_bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6029,10 +6448,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_277_t
 }
 
 // ['_thnn_differentiable_lstm_cell_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_278_t)(const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_292_t)(const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_278_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &>(
-  batch_rule_278_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_292_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, const Tensor &, const Tensor &>(
+  batch_rule_292_t batch_rule,
   const c10::optional<Tensor> & grad_hy, const c10::optional<Tensor> & grad_cy, const Tensor & input_gates, const Tensor & hidden_gates, const c10::optional<Tensor> & input_bias, const c10::optional<Tensor> & hidden_bias, const Tensor & cx, const Tensor & cy
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6076,10 +6495,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_278_t
 }
 
 // ['_thnn_fused_gru_cell']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_279_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_293_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_279_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_279_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_293_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_293_t batch_rule,
   const Tensor & input_gates, const Tensor & hidden_gates, const Tensor & hx, const c10::optional<Tensor> & input_bias, const c10::optional<Tensor> & hidden_bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6110,10 +6529,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_279_t,std::tuple<Tensor,Te
 }
 
 // ['_thnn_fused_gru_cell_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_280_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_294_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_280_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, bool>(
-  batch_rule_280_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_294_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, bool>(
+  batch_rule_294_t batch_rule,
   const Tensor & grad_hy, const Tensor & workspace, bool has_bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6131,10 +6550,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_280_t
 }
 
 // ['_thnn_differentiable_gru_cell_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_281_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_295_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_281_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_281_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_295_t,std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_295_t batch_rule,
   const Tensor & grad_hy, const Tensor & input_gates, const Tensor & hidden_gates, const Tensor & hx, const c10::optional<Tensor> & input_bias, const c10::optional<Tensor> & hidden_bias
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6168,10 +6587,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_281_t
 }
 
 // ['gru_cell', 'rnn_tanh_cell', 'rnn_relu_cell']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_282_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_296_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_282_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
-  batch_rule_282_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_296_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &>(
+  batch_rule_296_t batch_rule,
   const Tensor & input, const Tensor & hx, const Tensor & w_ih, const Tensor & w_hh, const c10::optional<Tensor> & b_ih, const c10::optional<Tensor> & b_hh
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6205,10 +6624,10 @@ Tensor lowerToNextLayer<batch_rule_282_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['quantized_gru_cell', 'quantized_rnn_relu_cell', 'quantized_rnn_tanh_cell']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_283_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Scalar &, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_297_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Scalar &, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_283_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, const Scalar &, const Scalar &>(
-  batch_rule_283_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_297_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, const Scalar &, const Scalar &>(
+  batch_rule_297_t batch_rule,
   const Tensor & input, const Tensor & hx, const Tensor & w_ih, const Tensor & w_hh, const Tensor & b_ih, const Tensor & b_hh, const Tensor & packed_ih, const Tensor & packed_hh, const Tensor & col_offsets_ih, const Tensor & col_offsets_hh, const Scalar & scale_ih, const Scalar & scale_hh, const Scalar & zero_point_ih, const Scalar & zero_point_hh
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6250,10 +6669,10 @@ Tensor lowerToNextLayer<batch_rule_283_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_pack_padded_sequence']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_284_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_298_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_284_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, bool>(
-  batch_rule_284_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_298_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, bool>(
+  batch_rule_298_t batch_rule,
   const Tensor & input, const Tensor & lengths, bool batch_first
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6271,10 +6690,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_284_t,std::tuple<Tensor,Te
 }
 
 // ['_pack_padded_sequence_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_285_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_299_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_285_t,Tensor,const Tensor &, IntArrayRef, const Tensor &, bool>(
-  batch_rule_285_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_299_t,Tensor,const Tensor &, IntArrayRef, const Tensor &, bool>(
+  batch_rule_299_t batch_rule,
   const Tensor & grad, IntArrayRef input_size, const Tensor & batch_sizes, bool batch_first
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6292,10 +6711,10 @@ Tensor lowerToNextLayer<batch_rule_285_t,Tensor,const Tensor &, IntArrayRef, con
 }
 
 // ['_pad_packed_sequence']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_286_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, const Scalar &, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_300_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, const Scalar &, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_286_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, bool, const Scalar &, int64_t>(
-  batch_rule_286_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_300_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, bool, const Scalar &, int64_t>(
+  batch_rule_300_t batch_rule,
   const Tensor & data, const Tensor & batch_sizes, bool batch_first, const Scalar & padding_value, int64_t total_length
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6313,10 +6732,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_286_t,std::tuple<Tensor,Te
 }
 
 // ['put']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_287_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_301_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_287_t,Tensor,const Tensor &, const Tensor &, const Tensor &, bool>(
-  batch_rule_287_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_301_t,Tensor,const Tensor &, const Tensor &, const Tensor &, bool>(
+  batch_rule_301_t batch_rule,
   const Tensor & self, const Tensor & index, const Tensor & source, bool accumulate
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6337,10 +6756,10 @@ Tensor lowerToNextLayer<batch_rule_287_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['index_add.alpha']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_288_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_302_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_288_t,Tensor,const Tensor &, int64_t, const Tensor &, const Tensor &, const Scalar &>(
-  batch_rule_288_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_302_t,Tensor,const Tensor &, int64_t, const Tensor &, const Tensor &, const Scalar &>(
+  batch_rule_302_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, const Tensor & source, const Scalar & alpha
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6361,10 +6780,10 @@ Tensor lowerToNextLayer<batch_rule_288_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['index_add.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_289_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_303_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_289_t,Tensor,const Tensor &, Dimname, const Tensor &, const Tensor &, const Scalar &>(
-  batch_rule_289_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_303_t,Tensor,const Tensor &, Dimname, const Tensor &, const Tensor &, const Scalar &>(
+  batch_rule_303_t batch_rule,
   const Tensor & self, Dimname dim, const Tensor & index, const Tensor & source, const Scalar & alpha
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6385,10 +6804,10 @@ Tensor lowerToNextLayer<batch_rule_289_t,Tensor,const Tensor &, Dimname, const T
 }
 
 // ['index_fill.int_Scalar', 'scatter.value']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_290_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_304_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_290_t,Tensor,const Tensor &, int64_t, const Tensor &, const Scalar &>(
-  batch_rule_290_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_304_t,Tensor,const Tensor &, int64_t, const Tensor &, const Scalar &>(
+  batch_rule_304_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, const Scalar & value
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6406,10 +6825,10 @@ Tensor lowerToNextLayer<batch_rule_290_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['index_fill.Dimname_Scalar', 'scatter.dimname_value']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_291_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_305_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_291_t,Tensor,const Tensor &, Dimname, const Tensor &, const Scalar &>(
-  batch_rule_291_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_305_t,Tensor,const Tensor &, Dimname, const Tensor &, const Scalar &>(
+  batch_rule_305_t batch_rule,
   const Tensor & self, Dimname dim, const Tensor & index, const Scalar & value
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6427,10 +6846,10 @@ Tensor lowerToNextLayer<batch_rule_291_t,Tensor,const Tensor &, Dimname, const T
 }
 
 // ['scatter.reduce']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_292_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_306_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_292_t,Tensor,const Tensor &, int64_t, const Tensor &, const Tensor &, c10::string_view>(
-  batch_rule_292_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_306_t,Tensor,const Tensor &, int64_t, const Tensor &, const Tensor &, c10::string_view>(
+  batch_rule_306_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, const Tensor & src, c10::string_view reduce
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6451,10 +6870,10 @@ Tensor lowerToNextLayer<batch_rule_292_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['scatter.value_reduce']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_293_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Scalar &, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_307_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, const Scalar &, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_293_t,Tensor,const Tensor &, int64_t, const Tensor &, const Scalar &, c10::string_view>(
-  batch_rule_293_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_307_t,Tensor,const Tensor &, int64_t, const Tensor &, const Scalar &, c10::string_view>(
+  batch_rule_307_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, const Scalar & value, c10::string_view reduce
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6472,10 +6891,10 @@ Tensor lowerToNextLayer<batch_rule_293_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['_scatter_reduce']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_294_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, c10::string_view, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_308_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, c10::string_view, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_294_t,Tensor,const Tensor &, int64_t, const Tensor &, c10::string_view, c10::optional<int64_t>>(
-  batch_rule_294_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_308_t,Tensor,const Tensor &, int64_t, const Tensor &, c10::string_view, c10::optional<int64_t>>(
+  batch_rule_308_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, c10::string_view reduce, c10::optional<int64_t> output_size
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6493,10 +6912,10 @@ Tensor lowerToNextLayer<batch_rule_294_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['diag_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_295_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_309_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_295_t,Tensor,const Tensor &, IntArrayRef, int64_t>(
-  batch_rule_295_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_309_t,Tensor,const Tensor &, IntArrayRef, int64_t>(
+  batch_rule_309_t batch_rule,
   const Tensor & grad, IntArrayRef input_sizes, int64_t diagonal
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6511,10 +6930,10 @@ Tensor lowerToNextLayer<batch_rule_295_t,Tensor,const Tensor &, IntArrayRef, int
 }
 
 // ['cross', 'take_along_dim']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_296_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_310_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_296_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>>(
-  batch_rule_296_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_310_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>>(
+  batch_rule_310_t batch_rule,
   const Tensor & self, const Tensor & other, c10::optional<int64_t> dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6532,10 +6951,10 @@ Tensor lowerToNextLayer<batch_rule_296_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['index_select']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_297_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_311_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_297_t,Tensor,const Tensor &, int64_t, const Tensor &>(
-  batch_rule_297_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_311_t,Tensor,const Tensor &, int64_t, const Tensor &>(
+  batch_rule_311_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6553,10 +6972,10 @@ Tensor lowerToNextLayer<batch_rule_297_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['index_select.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_298_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_312_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_298_t,Tensor,const Tensor &, Dimname, const Tensor &>(
-  batch_rule_298_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_312_t,Tensor,const Tensor &, Dimname, const Tensor &>(
+  batch_rule_312_t batch_rule,
   const Tensor & self, Dimname dim, const Tensor & index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6574,10 +6993,10 @@ Tensor lowerToNextLayer<batch_rule_298_t,Tensor,const Tensor &, Dimname, const T
 }
 
 // ['index_select_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_299_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_313_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, int64_t, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_299_t,Tensor,const Tensor &, IntArrayRef, int64_t, const Tensor &>(
-  batch_rule_299_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_313_t,Tensor,const Tensor &, IntArrayRef, int64_t, const Tensor &>(
+  batch_rule_313_t batch_rule,
   const Tensor & grad, IntArrayRef self_sizes, int64_t dim, const Tensor & index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6595,10 +7014,10 @@ Tensor lowerToNextLayer<batch_rule_299_t,Tensor,const Tensor &, IntArrayRef, int
 }
 
 // ['gather']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_300_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_314_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_300_t,Tensor,const Tensor &, int64_t, const Tensor &, bool>(
-  batch_rule_300_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_314_t,Tensor,const Tensor &, int64_t, const Tensor &, bool>(
+  batch_rule_314_t batch_rule,
   const Tensor & self, int64_t dim, const Tensor & index, bool sparse_grad
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6616,10 +7035,10 @@ Tensor lowerToNextLayer<batch_rule_300_t,Tensor,const Tensor &, int64_t, const T
 }
 
 // ['gather_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_301_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_315_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_301_t,Tensor,const Tensor &, const Tensor &, int64_t, const Tensor &, bool>(
-  batch_rule_301_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_315_t,Tensor,const Tensor &, const Tensor &, int64_t, const Tensor &, bool>(
+  batch_rule_315_t batch_rule,
   const Tensor & grad, const Tensor & self, int64_t dim, const Tensor & index, bool sparse_grad
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6640,10 +7059,10 @@ Tensor lowerToNextLayer<batch_rule_301_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['gather.dimname']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_302_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_316_t)(const Tensor &, c10::optional<int64_t>, Dimname, const Tensor &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_302_t,Tensor,const Tensor &, Dimname, const Tensor &, bool>(
-  batch_rule_302_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_316_t,Tensor,const Tensor &, Dimname, const Tensor &, bool>(
+  batch_rule_316_t batch_rule,
   const Tensor & self, Dimname dim, const Tensor & index, bool sparse_grad
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6661,10 +7080,10 @@ Tensor lowerToNextLayer<batch_rule_302_t,Tensor,const Tensor &, Dimname, const T
 }
 
 // ['addcmul', 'addcdiv']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_303_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_317_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_303_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &>(
-  batch_rule_303_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_317_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &>(
+  batch_rule_317_t batch_rule,
   const Tensor & self, const Tensor & tensor1, const Tensor & tensor2, const Scalar & value
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6685,10 +7104,10 @@ Tensor lowerToNextLayer<batch_rule_303_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['cross_entropy_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_304_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_318_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_304_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t, double>(
-  batch_rule_304_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_318_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t, double>(
+  batch_rule_318_t batch_rule,
   const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, int64_t reduction, int64_t ignore_index, double label_smoothing
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6711,10 +7130,10 @@ Tensor lowerToNextLayer<batch_rule_304_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['lstsq', 'solve', '_solve_helper']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_305_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_319_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_305_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &>(
-  batch_rule_305_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_319_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &>(
+  batch_rule_319_t batch_rule,
   const Tensor & self, const Tensor & A
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6732,10 +7151,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_305_t,std::tuple<Tensor,Te
 }
 
 // ['triangular_solve']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_306_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_320_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_306_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, bool, bool, bool>(
-  batch_rule_306_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_320_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, bool, bool, bool>(
+  batch_rule_320_t batch_rule,
   const Tensor & self, const Tensor & A, bool upper, bool transpose, bool unitriangular
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6753,10 +7172,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_306_t,std::tuple<Tensor,Te
 }
 
 // ['linalg_solve_triangular']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_307_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_321_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_307_t,Tensor,const Tensor &, const Tensor &, bool, bool, bool>(
-  batch_rule_307_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_321_t,Tensor,const Tensor &, const Tensor &, bool, bool, bool>(
+  batch_rule_321_t batch_rule,
   const Tensor & self, const Tensor & B, bool upper, bool left, bool unitriangular
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6773,11 +7192,11 @@ Tensor lowerToNextLayer<batch_rule_307_t,Tensor,const Tensor &, const Tensor &,
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
-// ['svd', '_svd_helper', '_lu_with_info', 'linalg_lu_factor_ex']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_308_t)(const Tensor &, c10::optional<int64_t>, bool, bool);
+// ['svd', '_svd_helper', '_lu_with_info']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_322_t)(const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_308_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool, bool>(
-  batch_rule_308_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_322_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool, bool>(
+  batch_rule_322_t batch_rule,
   const Tensor & self, bool some, bool compute_uv
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6792,10 +7211,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_308_t,std::tuple<Te
 }
 
 // ['ormqr']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_309_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_323_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_309_t,Tensor,const Tensor &, const Tensor &, const Tensor &, bool, bool>(
-  batch_rule_309_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_323_t,Tensor,const Tensor &, const Tensor &, const Tensor &, bool, bool>(
+  batch_rule_323_t batch_rule,
   const Tensor & self, const Tensor & input2, const Tensor & input3, bool left, bool transpose
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6816,10 +7235,10 @@ Tensor lowerToNextLayer<batch_rule_309_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['lu_unpack']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_310_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_324_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_310_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, bool, bool>(
-  batch_rule_310_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_324_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, bool, bool>(
+  batch_rule_324_t batch_rule,
   const Tensor & LU_data, const Tensor & LU_pivots, bool unpack_data, bool unpack_pivots
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6837,10 +7256,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_310_t,std::tuple<Te
 }
 
 // ['multinomial']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_311_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, c10::optional<Generator>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_325_t)(const Tensor &, c10::optional<int64_t>, int64_t, bool, c10::optional<Generator>);
 template <>
-Tensor lowerToNextLayer<batch_rule_311_t,Tensor,const Tensor &, int64_t, bool, c10::optional<Generator>>(
-  batch_rule_311_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_325_t,Tensor,const Tensor &, int64_t, bool, c10::optional<Generator>>(
+  batch_rule_325_t batch_rule,
   const Tensor & self, int64_t num_samples, bool replacement, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6855,10 +7274,10 @@ Tensor lowerToNextLayer<batch_rule_311_t,Tensor,const Tensor &, int64_t, bool, c
 }
 
 // ['polygamma', 'special_polygamma']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_312_t)(int64_t, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_326_t)(int64_t, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_312_t,Tensor,int64_t, const Tensor &>(
-  batch_rule_312_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_326_t,Tensor,int64_t, const Tensor &>(
+  batch_rule_326_t batch_rule,
   int64_t n, const Tensor & self
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6873,10 +7292,10 @@ Tensor lowerToNextLayer<batch_rule_312_t,Tensor,int64_t, const Tensor &>(
 }
 
 // ['histc']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_313_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Scalar &, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_327_t)(const Tensor &, c10::optional<int64_t>, int64_t, const Scalar &, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_313_t,Tensor,const Tensor &, int64_t, const Scalar &, const Scalar &>(
-  batch_rule_313_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_327_t,Tensor,const Tensor &, int64_t, const Scalar &, const Scalar &>(
+  batch_rule_327_t batch_rule,
   const Tensor & self, int64_t bins, const Scalar & min, const Scalar & max
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6891,10 +7310,10 @@ Tensor lowerToNextLayer<batch_rule_313_t,Tensor,const Tensor &, int64_t, const S
 }
 
 // ['histogram.bins_tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_314_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_328_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_314_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, bool>(
-  batch_rule_314_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_328_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, bool>(
+  batch_rule_328_t batch_rule,
   const Tensor & self, const Tensor & bins, const c10::optional<Tensor> & weight, bool density
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6917,10 +7336,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_314_t,std::tuple<Tensor,Te
 }
 
 // ['histogram.bin_ct']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_315_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_329_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_315_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, bool>(
-  batch_rule_315_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_329_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, bool>(
+  batch_rule_329_t batch_rule,
   const Tensor & self, int64_t bins, c10::optional<ArrayRef<double>> range, const c10::optional<Tensor> & weight, bool density
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6940,10 +7359,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_315_t,std::tuple<Tensor,Te
 }
 
 // ['_histogramdd_bin_edges']
-typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_316_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
+typedef std::tuple<::std::vector<Tensor>,c10::optional<int64_t>> (*batch_rule_330_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
 template <>
-::std::vector<Tensor> lowerToNextLayer<batch_rule_316_t,::std::vector<Tensor>,const Tensor &, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, bool>(
-  batch_rule_316_t batch_rule,
+::std::vector<Tensor> lowerToNextLayer<batch_rule_330_t,::std::vector<Tensor>,const Tensor &, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, bool>(
+  batch_rule_330_t batch_rule,
   const Tensor & self, IntArrayRef bins, c10::optional<ArrayRef<double>> range, const c10::optional<Tensor> & weight, bool density
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6963,10 +7382,10 @@ ::std::vector<Tensor> lowerToNextLayer<batch_rule_316_t,::std::vector<Tensor>,co
 }
 
 // ['_histogramdd_from_bin_cts']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_317_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_331_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_317_t,Tensor,const Tensor &, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, bool>(
-  batch_rule_317_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_331_t,Tensor,const Tensor &, IntArrayRef, c10::optional<ArrayRef<double>>, const c10::optional<Tensor> &, bool>(
+  batch_rule_331_t batch_rule,
   const Tensor & self, IntArrayRef bins, c10::optional<ArrayRef<double>> range, const c10::optional<Tensor> & weight, bool density
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -6986,10 +7405,10 @@ Tensor lowerToNextLayer<batch_rule_317_t,Tensor,const Tensor &, IntArrayRef, c10
 }
 
 // ['quantile.scalar', 'nanquantile.scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_318_t)(const Tensor &, c10::optional<int64_t>, double, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_332_t)(const Tensor &, c10::optional<int64_t>, double, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_318_t,Tensor,const Tensor &, double, c10::optional<int64_t>, bool>(
-  batch_rule_318_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_332_t,Tensor,const Tensor &, double, c10::optional<int64_t>, bool>(
+  batch_rule_332_t batch_rule,
   const Tensor & self, double q, c10::optional<int64_t> dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7004,10 +7423,10 @@ Tensor lowerToNextLayer<batch_rule_318_t,Tensor,const Tensor &, double, c10::opt
 }
 
 // ['quantile', 'nanquantile']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_319_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_333_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_319_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>, bool>(
-  batch_rule_319_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_333_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>, bool>(
+  batch_rule_333_t batch_rule,
   const Tensor & self, const Tensor & q, c10::optional<int64_t> dim, bool keepdim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7025,10 +7444,10 @@ Tensor lowerToNextLayer<batch_rule_319_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['quantile.new_scalar', 'nanquantile.new_scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_320_t)(const Tensor &, c10::optional<int64_t>, double, c10::optional<int64_t>, bool, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_334_t)(const Tensor &, c10::optional<int64_t>, double, c10::optional<int64_t>, bool, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_320_t,Tensor,const Tensor &, double, c10::optional<int64_t>, bool, c10::string_view>(
-  batch_rule_320_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_334_t,Tensor,const Tensor &, double, c10::optional<int64_t>, bool, c10::string_view>(
+  batch_rule_334_t batch_rule,
   const Tensor & self, double q, c10::optional<int64_t> dim, bool keepdim, c10::string_view interpolation
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7043,10 +7462,10 @@ Tensor lowerToNextLayer<batch_rule_320_t,Tensor,const Tensor &, double, c10::opt
 }
 
 // ['quantile.new', 'nanquantile.new']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_321_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, bool, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_335_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, bool, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_321_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>, bool, c10::string_view>(
-  batch_rule_321_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_335_t,Tensor,const Tensor &, const Tensor &, c10::optional<int64_t>, bool, c10::string_view>(
+  batch_rule_335_t batch_rule,
   const Tensor & self, const Tensor & q, c10::optional<int64_t> dim, bool keepdim, c10::string_view interpolation
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7064,10 +7483,10 @@ Tensor lowerToNextLayer<batch_rule_321_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['sort.stable']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_322_t)(const Tensor &, c10::optional<int64_t>, c10::optional<bool>, int64_t, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_336_t)(const Tensor &, c10::optional<int64_t>, c10::optional<bool>, int64_t, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_322_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<bool>, int64_t, bool>(
-  batch_rule_322_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_336_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<bool>, int64_t, bool>(
+  batch_rule_336_t batch_rule,
   const Tensor & self, c10::optional<bool> stable, int64_t dim, bool descending
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7082,10 +7501,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_322_t,std::tuple<Tensor,Te
 }
 
 // ['sort.dimname_stable']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_323_t)(const Tensor &, c10::optional<int64_t>, c10::optional<bool>, Dimname, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_337_t)(const Tensor &, c10::optional<int64_t>, c10::optional<bool>, Dimname, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_323_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<bool>, Dimname, bool>(
-  batch_rule_323_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_337_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::optional<bool>, Dimname, bool>(
+  batch_rule_337_t batch_rule,
   const Tensor & self, c10::optional<bool> stable, Dimname dim, bool descending
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7100,10 +7519,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_323_t,std::tuple<Tensor,Te
 }
 
 // ['topk']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_324_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_338_t)(const Tensor &, c10::optional<int64_t>, int64_t, int64_t, bool, bool);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_324_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, int64_t, bool, bool>(
-  batch_rule_324_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_338_t,std::tuple<Tensor,Tensor>,const Tensor &, int64_t, int64_t, bool, bool>(
+  batch_rule_338_t batch_rule,
   const Tensor & self, int64_t k, int64_t dim, bool largest, bool sorted
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7118,10 +7537,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_324_t,std::tuple<Tensor,Te
 }
 
 // ['renorm']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_325_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, int64_t, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_339_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, int64_t, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_325_t,Tensor,const Tensor &, const Scalar &, int64_t, const Scalar &>(
-  batch_rule_325_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_339_t,Tensor,const Tensor &, const Scalar &, int64_t, const Scalar &>(
+  batch_rule_339_t batch_rule,
   const Tensor & self, const Scalar & p, int64_t dim, const Scalar & maxnorm
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7136,10 +7555,10 @@ Tensor lowerToNextLayer<batch_rule_325_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['normal.float_Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_326_t)(double, const Tensor &, c10::optional<int64_t>, c10::optional<Generator>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_340_t)(double, const Tensor &, c10::optional<int64_t>, c10::optional<Generator>);
 template <>
-Tensor lowerToNextLayer<batch_rule_326_t,Tensor,double, const Tensor &, c10::optional<Generator>>(
-  batch_rule_326_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_340_t,Tensor,double, const Tensor &, c10::optional<Generator>>(
+  batch_rule_340_t batch_rule,
   double mean, const Tensor & std, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7154,10 +7573,10 @@ Tensor lowerToNextLayer<batch_rule_326_t,Tensor,double, const Tensor &, c10::opt
 }
 
 // ['searchsorted.Tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_327_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_341_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_327_t,Tensor,const Tensor &, const Tensor &, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &>(
-  batch_rule_327_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_341_t,Tensor,const Tensor &, const Tensor &, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &>(
+  batch_rule_341_t batch_rule,
   const Tensor & sorted_sequence, const Tensor & self, bool out_int32, bool right, c10::optional<c10::string_view> side, const c10::optional<Tensor> & sorter
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7180,10 +7599,10 @@ Tensor lowerToNextLayer<batch_rule_327_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['searchsorted.Scalar']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_328_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_342_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_328_t,Tensor,const Tensor &, const Scalar &, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &>(
-  batch_rule_328_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_342_t,Tensor,const Tensor &, const Scalar &, bool, bool, c10::optional<c10::string_view>, const c10::optional<Tensor> &>(
+  batch_rule_342_t batch_rule,
   const Tensor & sorted_sequence, const Scalar & self, bool out_int32, bool right, c10::optional<c10::string_view> side, const c10::optional<Tensor> & sorter
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7203,10 +7622,10 @@ Tensor lowerToNextLayer<batch_rule_328_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['multi_margin_loss']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_329_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_343_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_329_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_329_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_343_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_343_t batch_rule,
   const Tensor & self, const Tensor & target, const Scalar & p, const Scalar & margin, const c10::optional<Tensor> & weight, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7229,10 +7648,10 @@ Tensor lowerToNextLayer<batch_rule_329_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['multi_margin_loss_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_330_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_344_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_330_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_330_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_344_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_344_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, const Scalar & p, const Scalar & margin, const c10::optional<Tensor> & weight, int64_t reduction
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7258,10 +7677,10 @@ Tensor lowerToNextLayer<batch_rule_330_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['multilabel_margin_loss_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_331_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_345_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_331_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, const Tensor &>(
-  batch_rule_331_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_345_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, const Tensor &>(
+  batch_rule_345_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction, const Tensor & is_target
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7285,10 +7704,10 @@ Tensor lowerToNextLayer<batch_rule_331_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['nll_loss_nd', 'nll_loss', 'nll_loss2d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_332_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_346_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_332_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t>(
-  batch_rule_332_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_346_t,Tensor,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t>(
+  batch_rule_346_t batch_rule,
   const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, int64_t reduction, int64_t ignore_index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7311,10 +7730,10 @@ Tensor lowerToNextLayer<batch_rule_332_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['nll_loss_forward', 'nll_loss2d_forward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_333_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_347_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_333_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t>(
-  batch_rule_333_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_347_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t>(
+  batch_rule_347_t batch_rule,
   const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, int64_t reduction, int64_t ignore_index
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7337,10 +7756,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_333_t,std::tuple<Tensor,Te
 }
 
 // ['nll_loss_backward', 'nll_loss2d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_334_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_348_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, int64_t, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_334_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t, const Tensor &>(
-  batch_rule_334_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_348_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const c10::optional<Tensor> &, int64_t, int64_t, const Tensor &>(
+  batch_rule_348_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, const c10::optional<Tensor> & weight, int64_t reduction, int64_t ignore_index, const Tensor & total_weight
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7369,10 +7788,10 @@ Tensor lowerToNextLayer<batch_rule_334_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['smooth_l1_loss_backward', 'huber_loss_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_335_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, double);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_349_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, int64_t, double);
 template <>
-Tensor lowerToNextLayer<batch_rule_335_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, double>(
-  batch_rule_335_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_349_t,Tensor,const Tensor &, const Tensor &, const Tensor &, int64_t, double>(
+  batch_rule_349_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction, double beta
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7393,10 +7812,10 @@ Tensor lowerToNextLayer<batch_rule_335_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['elu']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_336_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_350_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_336_t,Tensor,const Tensor &, const Scalar &, const Scalar &, const Scalar &>(
-  batch_rule_336_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_350_t,Tensor,const Tensor &, const Scalar &, const Scalar &, const Scalar &>(
+  batch_rule_350_t batch_rule,
   const Tensor & self, const Scalar & alpha, const Scalar & scale, const Scalar & input_scale
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7411,10 +7830,10 @@ Tensor lowerToNextLayer<batch_rule_336_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['elu_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_337_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Scalar &, bool, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_351_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Scalar &, bool, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_337_t,Tensor,const Tensor &, const Scalar &, const Scalar &, const Scalar &, bool, const Tensor &>(
-  batch_rule_337_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_351_t,Tensor,const Tensor &, const Scalar &, const Scalar &, const Scalar &, bool, const Tensor &>(
+  batch_rule_351_t batch_rule,
   const Tensor & grad_output, const Scalar & alpha, const Scalar & scale, const Scalar & input_scale, bool is_result, const Tensor & self_or_result
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7432,10 +7851,10 @@ Tensor lowerToNextLayer<batch_rule_337_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['hardtanh_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_338_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_352_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &);
 template <>
-Tensor lowerToNextLayer<batch_rule_338_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &>(
-  batch_rule_338_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_352_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &>(
+  batch_rule_352_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Scalar & min_val, const Scalar & max_val
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7453,10 +7872,10 @@ Tensor lowerToNextLayer<batch_rule_338_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['leaky_relu_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_339_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_353_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_339_t,Tensor,const Tensor &, const Tensor &, const Scalar &, bool>(
-  batch_rule_339_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_353_t,Tensor,const Tensor &, const Tensor &, const Scalar &, bool>(
+  batch_rule_353_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Scalar & negative_slope, bool self_is_result
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7474,10 +7893,10 @@ Tensor lowerToNextLayer<batch_rule_339_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['rrelu_with_noise']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_340_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, bool, c10::optional<Generator>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_354_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, bool, c10::optional<Generator>);
 template <>
-Tensor lowerToNextLayer<batch_rule_340_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &, bool, c10::optional<Generator>>(
-  batch_rule_340_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_354_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &, bool, c10::optional<Generator>>(
+  batch_rule_354_t batch_rule,
   const Tensor & self, const Tensor & noise, const Scalar & lower, const Scalar & upper, bool training, c10::optional<Generator> generator
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7495,10 +7914,10 @@ Tensor lowerToNextLayer<batch_rule_340_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['rrelu_with_noise_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_341_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, bool, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_355_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, bool, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_341_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, bool, bool>(
-  batch_rule_341_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_355_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Scalar &, const Scalar &, bool, bool>(
+  batch_rule_355_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & noise, const Scalar & lower, const Scalar & upper, bool training, bool self_is_result
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7519,10 +7938,10 @@ Tensor lowerToNextLayer<batch_rule_341_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['softplus_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_342_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_356_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Scalar &, const Scalar &, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_342_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &, const Tensor &>(
-  batch_rule_342_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_356_t,Tensor,const Tensor &, const Tensor &, const Scalar &, const Scalar &, const Tensor &>(
+  batch_rule_356_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Scalar & beta, const Scalar & threshold, const Tensor & output
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7543,10 +7962,10 @@ Tensor lowerToNextLayer<batch_rule_342_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['avg_pool2d', 'avg_pool3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_343_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_357_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_343_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>>(
-  batch_rule_343_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_357_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>>(
+  batch_rule_357_t batch_rule,
   const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7561,10 +7980,10 @@ Tensor lowerToNextLayer<batch_rule_343_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['avg_pool2d_backward', 'avg_pool3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_344_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_358_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_344_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>>(
-  batch_rule_344_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_358_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, bool, bool, c10::optional<int64_t>>(
+  batch_rule_358_t batch_rule,
   const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7582,10 +8001,10 @@ Tensor lowerToNextLayer<batch_rule_344_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['fractional_max_pool2d', 'fractional_max_pool3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_345_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_359_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_345_t,std::tuple<Tensor,Tensor>,const Tensor &, IntArrayRef, IntArrayRef, const Tensor &>(
-  batch_rule_345_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_359_t,std::tuple<Tensor,Tensor>,const Tensor &, IntArrayRef, IntArrayRef, const Tensor &>(
+  batch_rule_359_t batch_rule,
   const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & random_samples
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7603,10 +8022,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_345_t,std::tuple<Tensor,Te
 }
 
 // ['fractional_max_pool2d_backward', 'fractional_max_pool3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_346_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_360_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_346_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, const Tensor &>(
-  batch_rule_346_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_360_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, const Tensor &>(
+  batch_rule_360_t batch_rule,
   const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & indices
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7627,10 +8046,10 @@ Tensor lowerToNextLayer<batch_rule_346_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['max_pool2d_with_indices_backward', 'max_pool3d_with_indices_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_347_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_361_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_347_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool, const Tensor &>(
-  batch_rule_347_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_361_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, bool, const Tensor &>(
+  batch_rule_361_t batch_rule,
   const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, const Tensor & indices
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7651,10 +8070,10 @@ Tensor lowerToNextLayer<batch_rule_347_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['max_unpool3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_348_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_362_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_348_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef>(
-  batch_rule_348_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_362_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef>(
+  batch_rule_362_t batch_rule,
   const Tensor & self, const Tensor & indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7672,10 +8091,10 @@ Tensor lowerToNextLayer<batch_rule_348_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['max_unpool3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_349_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_363_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_349_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef>(
-  batch_rule_349_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_363_t,Tensor,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef>(
+  batch_rule_363_t batch_rule,
   const Tensor & grad_output, const Tensor & self, const Tensor & indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7696,10 +8115,10 @@ Tensor lowerToNextLayer<batch_rule_349_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['upsample_linear1d.vec', 'upsample_bilinear2d.vec', '_upsample_bilinear2d_aa.vec', 'upsample_trilinear3d.vec', 'upsample_bicubic2d.vec']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_350_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, bool, c10::optional<ArrayRef<double>>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_364_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, bool, c10::optional<ArrayRef<double>>);
 template <>
-Tensor lowerToNextLayer<batch_rule_350_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, bool, c10::optional<ArrayRef<double>>>(
-  batch_rule_350_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_364_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, bool, c10::optional<ArrayRef<double>>>(
+  batch_rule_364_t batch_rule,
   const Tensor & input, c10::optional<IntArrayRef> output_size, bool align_corners, c10::optional<ArrayRef<double>> scale_factors
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7714,10 +8133,10 @@ Tensor lowerToNextLayer<batch_rule_350_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['upsample_linear1d_backward.vec', 'upsample_bilinear2d_backward.vec', '_upsample_bilinear2d_aa_backward.vec', 'upsample_trilinear3d_backward.vec', 'upsample_bicubic2d_backward.vec']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_351_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, IntArrayRef, bool, c10::optional<ArrayRef<double>>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_365_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, IntArrayRef, bool, c10::optional<ArrayRef<double>>);
 template <>
-Tensor lowerToNextLayer<batch_rule_351_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, IntArrayRef, bool, c10::optional<ArrayRef<double>>>(
-  batch_rule_351_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_365_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, IntArrayRef, bool, c10::optional<ArrayRef<double>>>(
+  batch_rule_365_t batch_rule,
   const Tensor & grad_output, c10::optional<IntArrayRef> output_size, IntArrayRef input_size, bool align_corners, c10::optional<ArrayRef<double>> scale_factors
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7732,10 +8151,10 @@ Tensor lowerToNextLayer<batch_rule_351_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['upsample_nearest1d.vec', '_upsample_nearest_exact1d.vec', 'upsample_nearest2d.vec', '_upsample_nearest_exact2d.vec', 'upsample_nearest3d.vec', '_upsample_nearest_exact3d.vec']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_352_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<ArrayRef<double>>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_366_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<ArrayRef<double>>);
 template <>
-Tensor lowerToNextLayer<batch_rule_352_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, c10::optional<ArrayRef<double>>>(
-  batch_rule_352_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_366_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, c10::optional<ArrayRef<double>>>(
+  batch_rule_366_t batch_rule,
   const Tensor & input, c10::optional<IntArrayRef> output_size, c10::optional<ArrayRef<double>> scale_factors
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7750,10 +8169,10 @@ Tensor lowerToNextLayer<batch_rule_352_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['upsample_nearest1d_backward.vec', '_upsample_nearest_exact1d_backward.vec', 'upsample_nearest2d_backward.vec', '_upsample_nearest_exact2d_backward.vec', 'upsample_nearest3d_backward.vec', '_upsample_nearest_exact3d_backward.vec']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_353_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<ArrayRef<double>>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_367_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<ArrayRef<double>>);
 template <>
-Tensor lowerToNextLayer<batch_rule_353_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<ArrayRef<double>>>(
-  batch_rule_353_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_367_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<ArrayRef<double>>>(
+  batch_rule_367_t batch_rule,
   const Tensor & grad_output, c10::optional<IntArrayRef> output_size, IntArrayRef input_size, c10::optional<ArrayRef<double>> scale_factors
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7768,10 +8187,10 @@ Tensor lowerToNextLayer<batch_rule_353_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['upsample_linear1d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_354_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_368_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_354_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<double>>(
-  batch_rule_354_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_368_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<double>>(
+  batch_rule_368_t batch_rule,
   const Tensor & self, IntArrayRef output_size, bool align_corners, c10::optional<double> scales
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7786,10 +8205,10 @@ Tensor lowerToNextLayer<batch_rule_354_t,Tensor,const Tensor &, IntArrayRef, boo
 }
 
 // ['upsample_linear1d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_355_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, bool, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_369_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, bool, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_355_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, bool, c10::optional<double>>(
-  batch_rule_355_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_369_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, bool, c10::optional<double>>(
+  batch_rule_369_t batch_rule,
   const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners, c10::optional<double> scales
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7804,10 +8223,10 @@ Tensor lowerToNextLayer<batch_rule_355_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['upsample_bilinear2d', '_upsample_bilinear2d_aa', 'upsample_bicubic2d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_356_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_370_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_356_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<double>, c10::optional<double>>(
-  batch_rule_356_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_370_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<double>, c10::optional<double>>(
+  batch_rule_370_t batch_rule,
   const Tensor & self, IntArrayRef output_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7822,10 +8241,10 @@ Tensor lowerToNextLayer<batch_rule_356_t,Tensor,const Tensor &, IntArrayRef, boo
 }
 
 // ['upsample_bilinear2d_backward', '_upsample_bilinear2d_aa_backward', 'upsample_bicubic2d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_357_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_371_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_357_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>>(
-  batch_rule_357_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_371_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>>(
+  batch_rule_371_t batch_rule,
   const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7840,10 +8259,10 @@ Tensor lowerToNextLayer<batch_rule_357_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['upsample_trilinear3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_358_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_372_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_358_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
-  batch_rule_358_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_372_t,Tensor,const Tensor &, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
+  batch_rule_372_t batch_rule,
   const Tensor & self, IntArrayRef output_size, bool align_corners, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7858,10 +8277,10 @@ Tensor lowerToNextLayer<batch_rule_358_t,Tensor,const Tensor &, IntArrayRef, boo
 }
 
 // ['upsample_trilinear3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_359_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_373_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_359_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
-  batch_rule_359_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_373_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, bool, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
+  batch_rule_373_t batch_rule,
   const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7876,10 +8295,10 @@ Tensor lowerToNextLayer<batch_rule_359_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['upsample_nearest1d', '_upsample_nearest_exact1d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_360_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_374_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_360_t,Tensor,const Tensor &, IntArrayRef, c10::optional<double>>(
-  batch_rule_360_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_374_t,Tensor,const Tensor &, IntArrayRef, c10::optional<double>>(
+  batch_rule_374_t batch_rule,
   const Tensor & self, IntArrayRef output_size, c10::optional<double> scales
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7894,10 +8313,10 @@ Tensor lowerToNextLayer<batch_rule_360_t,Tensor,const Tensor &, IntArrayRef, c10
 }
 
 // ['upsample_nearest1d_backward', '_upsample_nearest_exact1d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_361_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_375_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_361_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<double>>(
-  batch_rule_361_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_375_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<double>>(
+  batch_rule_375_t batch_rule,
   const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, c10::optional<double> scales
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7912,10 +8331,10 @@ Tensor lowerToNextLayer<batch_rule_361_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['upsample_nearest2d', '_upsample_nearest_exact2d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_362_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_376_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_362_t,Tensor,const Tensor &, IntArrayRef, c10::optional<double>, c10::optional<double>>(
-  batch_rule_362_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_376_t,Tensor,const Tensor &, IntArrayRef, c10::optional<double>, c10::optional<double>>(
+  batch_rule_376_t batch_rule,
   const Tensor & self, IntArrayRef output_size, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7930,10 +8349,10 @@ Tensor lowerToNextLayer<batch_rule_362_t,Tensor,const Tensor &, IntArrayRef, c10
 }
 
 // ['upsample_nearest2d_backward', '_upsample_nearest_exact2d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_363_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_377_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_363_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>>(
-  batch_rule_363_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_377_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>>(
+  batch_rule_377_t batch_rule,
   const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7948,10 +8367,10 @@ Tensor lowerToNextLayer<batch_rule_363_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['upsample_nearest3d', '_upsample_nearest_exact3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_364_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_378_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_364_t,Tensor,const Tensor &, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
-  batch_rule_364_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_378_t,Tensor,const Tensor &, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
+  batch_rule_378_t batch_rule,
   const Tensor & self, IntArrayRef output_size, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7966,10 +8385,10 @@ Tensor lowerToNextLayer<batch_rule_364_t,Tensor,const Tensor &, IntArrayRef, c10
 }
 
 // ['upsample_nearest3d_backward', '_upsample_nearest_exact3d_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_365_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_379_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_365_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
-  batch_rule_365_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_379_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, c10::optional<double>, c10::optional<double>, c10::optional<double>>(
+  batch_rule_379_t batch_rule,
   const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, c10::optional<double> scales_d, c10::optional<double> scales_h, c10::optional<double> scales_w
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -7984,10 +8403,10 @@ Tensor lowerToNextLayer<batch_rule_365_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['logit_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_366_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<double>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_380_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<double>);
 template <>
-Tensor lowerToNextLayer<batch_rule_366_t,Tensor,const Tensor &, const Tensor &, c10::optional<double>>(
-  batch_rule_366_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_380_t,Tensor,const Tensor &, const Tensor &, c10::optional<double>>(
+  batch_rule_380_t batch_rule,
   const Tensor & grad_output, const Tensor & self, c10::optional<double> eps
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8005,10 +8424,10 @@ Tensor lowerToNextLayer<batch_rule_366_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['slow_conv_transpose2d', 'slow_conv_transpose3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_367_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_381_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_367_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef>(
-  batch_rule_367_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_381_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef>(
+  batch_rule_381_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8030,11 +8449,41 @@ Tensor lowerToNextLayer<batch_rule_367_t,Tensor,const Tensor &, const Tensor &,
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['slow_conv_transpose2d_backward.output_mask', 'slow_conv_transpose3d_backward.output_mask']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_382_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_382_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, const Tensor &, const Tensor &, ::std::array<bool,3>>(
+  batch_rule_382_t batch_rule,
+  const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, const Tensor & columns, const Tensor & ones, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  Tensor columns_value;
+  optional<int64_t> columns_bdim;
+  std::tie(columns_value, columns_bdim) = unwrapTensorAtLevel(columns, cur_level);
+  Tensor ones_value;
+  optional<int64_t> ones_bdim;
+  std::tie(ones_value, ones_bdim) = unwrapTensorAtLevel(ones, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, self_value, self_bdim, weight_value, weight_bdim, kernel_size, stride, padding, output_padding, dilation, columns_value, columns_bdim, ones_value, ones_bdim, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['thnn_conv2d', 'slow_conv3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_368_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_383_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_368_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
-  batch_rule_368_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_383_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
+  batch_rule_383_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8057,10 +8506,10 @@ Tensor lowerToNextLayer<batch_rule_368_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_slow_conv2d_forward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_369_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_384_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_369_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
-  batch_rule_369_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_384_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
+  batch_rule_384_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8082,11 +8531,38 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_369_t,std::tuple<Tensor,Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
 }
 
+// ['_slow_conv2d_backward.output_mask']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_385_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_385_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, const Tensor &, ::std::array<bool,3>>(
+  batch_rule_385_t batch_rule,
+  const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, const Tensor & finput, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  Tensor finput_value;
+  optional<int64_t> finput_bdim;
+  std::tie(finput_value, finput_bdim) = unwrapTensorAtLevel(finput, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, self_value, self_bdim, weight_value, weight_bdim, kernel_size, stride, padding, finput_value, finput_bdim, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['_conv_depthwise2d', 'conv_depthwise3d', 'slow_conv_dilated2d', 'slow_conv_dilated3d']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_370_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_386_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_370_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef>(
-  batch_rule_370_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_386_t,Tensor,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef, IntArrayRef>(
+  batch_rule_386_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8108,11 +8584,59 @@ Tensor lowerToNextLayer<batch_rule_370_t,Tensor,const Tensor &, const Tensor &,
   return makeBatched(std::get<0>(results), std::get<1>(results), cur_level);
 }
 
+// ['_conv_depthwise2d_backward.output_mask']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_387_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, ::std::array<bool,2>);
+template <>
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_387_t,std::tuple<Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, ::std::array<bool,2>>(
+  batch_rule_387_t batch_rule,
+  const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, ::std::array<bool,2> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, self_value, self_bdim, weight_value, weight_bdim, kernel_size, stride, padding, dilation, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level));
+}
+
+// ['conv_depthwise3d_backward.output_mask', 'slow_conv_dilated2d_backward', 'slow_conv_dilated3d_backward']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_388_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_388_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, ::std::array<bool,3>>(
+  batch_rule_388_t batch_rule,
+  const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, self_value, self_bdim, weight_value, weight_bdim, kernel_size, stride, padding, dilation, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['slow_conv3d_forward']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_371_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_389_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, const c10::optional<Tensor> &, c10::optional<int64_t>, IntArrayRef, IntArrayRef);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_371_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
-  batch_rule_371_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_389_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, IntArrayRef, const c10::optional<Tensor> &, IntArrayRef, IntArrayRef>(
+  batch_rule_389_t batch_rule,
   const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const c10::optional<Tensor> & bias, IntArrayRef stride, IntArrayRef padding
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8134,11 +8658,41 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_371_t,std::tuple<Te
   return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
 }
 
+// ['slow_conv3d_backward.output_mask']
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_390_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, ::std::array<bool,3>);
+template <>
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_390_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, const Tensor &, const Tensor &, ::std::array<bool,3>>(
+  batch_rule_390_t batch_rule,
+  const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, const Tensor & finput, const Tensor & fgrad_input, ::std::array<bool,3> output_mask
+) {
+  c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
+  auto maybe_layer = maybeCurrentDynamicLayer();
+  TORCH_INTERNAL_ASSERT(maybe_layer.has_value());
+  int64_t cur_level = maybe_layer->layerId();
+  Tensor grad_output_value;
+  optional<int64_t> grad_output_bdim;
+  std::tie(grad_output_value, grad_output_bdim) = unwrapTensorAtLevel(grad_output, cur_level);
+  Tensor self_value;
+  optional<int64_t> self_bdim;
+  std::tie(self_value, self_bdim) = unwrapTensorAtLevel(self, cur_level);
+  Tensor weight_value;
+  optional<int64_t> weight_bdim;
+  std::tie(weight_value, weight_bdim) = unwrapTensorAtLevel(weight, cur_level);
+  Tensor finput_value;
+  optional<int64_t> finput_bdim;
+  std::tie(finput_value, finput_bdim) = unwrapTensorAtLevel(finput, cur_level);
+  Tensor fgrad_input_value;
+  optional<int64_t> fgrad_input_bdim;
+  std::tie(fgrad_input_value, fgrad_input_bdim) = unwrapTensorAtLevel(fgrad_input, cur_level);
+  auto results = batch_rule(grad_output_value, grad_output_bdim, self_value, self_bdim, weight_value, weight_bdim, kernel_size, stride, padding, finput_value, finput_bdim, fgrad_input_value, fgrad_input_bdim, output_mask);
+  return std::make_tuple(makeBatched(std::get<0>(results), std::get<1>(results), cur_level), makeBatched(std::get<2>(results), std::get<3>(results), cur_level), makeBatched(std::get<4>(results), std::get<5>(results), cur_level));
+}
+
 // ['col2im', 'im2col_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_372_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_391_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_372_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef>(
-  batch_rule_372_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_391_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef>(
+  batch_rule_391_t batch_rule,
   const Tensor & self, IntArrayRef output_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8153,10 +8707,10 @@ Tensor lowerToNextLayer<batch_rule_372_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['col2im_backward', 'im2col']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_373_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_392_t)(const Tensor &, c10::optional<int64_t>, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef);
 template <>
-Tensor lowerToNextLayer<batch_rule_373_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef>(
-  batch_rule_373_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_392_t,Tensor,const Tensor &, IntArrayRef, IntArrayRef, IntArrayRef, IntArrayRef>(
+  batch_rule_392_t batch_rule,
   const Tensor & grad_output, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8171,10 +8725,10 @@ Tensor lowerToNextLayer<batch_rule_373_t,Tensor,const Tensor &, IntArrayRef, Int
 }
 
 // ['fft_fft', 'fft_ifft', 'fft_rfft', 'fft_irfft', 'fft_hfft', 'fft_ihfft']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_374_t)(const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, int64_t, c10::optional<c10::string_view>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_393_t)(const Tensor &, c10::optional<int64_t>, c10::optional<int64_t>, int64_t, c10::optional<c10::string_view>);
 template <>
-Tensor lowerToNextLayer<batch_rule_374_t,Tensor,const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<c10::string_view>>(
-  batch_rule_374_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_393_t,Tensor,const Tensor &, c10::optional<int64_t>, int64_t, c10::optional<c10::string_view>>(
+  batch_rule_393_t batch_rule,
   const Tensor & self, c10::optional<int64_t> n, int64_t dim, c10::optional<c10::string_view> norm
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8189,10 +8743,10 @@ Tensor lowerToNextLayer<batch_rule_374_t,Tensor,const Tensor &, c10::optional<in
 }
 
 // ['fft_fft2', 'fft_ifft2', 'fft_rfft2', 'fft_irfft2', 'fft_hfft2', 'fft_ihfft2']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_375_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<c10::string_view>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_394_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<c10::string_view>);
 template <>
-Tensor lowerToNextLayer<batch_rule_375_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<c10::string_view>>(
-  batch_rule_375_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_394_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, IntArrayRef, c10::optional<c10::string_view>>(
+  batch_rule_394_t batch_rule,
   const Tensor & self, c10::optional<IntArrayRef> s, IntArrayRef dim, c10::optional<c10::string_view> norm
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8207,10 +8761,10 @@ Tensor lowerToNextLayer<batch_rule_375_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['fft_fftn', 'fft_ifftn', 'fft_rfftn', 'fft_irfftn', 'fft_hfftn', 'fft_ihfftn']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_376_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<IntArrayRef>, c10::optional<c10::string_view>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_395_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>, c10::optional<IntArrayRef>, c10::optional<c10::string_view>);
 template <>
-Tensor lowerToNextLayer<batch_rule_376_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, c10::optional<IntArrayRef>, c10::optional<c10::string_view>>(
-  batch_rule_376_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_395_t,Tensor,const Tensor &, c10::optional<IntArrayRef>, c10::optional<IntArrayRef>, c10::optional<c10::string_view>>(
+  batch_rule_395_t batch_rule,
   const Tensor & self, c10::optional<IntArrayRef> s, c10::optional<IntArrayRef> dim, c10::optional<c10::string_view> norm
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8225,10 +8779,10 @@ Tensor lowerToNextLayer<batch_rule_376_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['fft_fftshift', 'fft_ifftshift', '_test_optional_intlist', '_test_optional_filled_intlist']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_377_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_396_t)(const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>);
 template <>
-Tensor lowerToNextLayer<batch_rule_377_t,Tensor,const Tensor &, c10::optional<IntArrayRef>>(
-  batch_rule_377_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_396_t,Tensor,const Tensor &, c10::optional<IntArrayRef>>(
+  batch_rule_396_t batch_rule,
   const Tensor & self, c10::optional<IntArrayRef> dim
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8243,10 +8797,10 @@ Tensor lowerToNextLayer<batch_rule_377_t,Tensor,const Tensor &, c10::optional<In
 }
 
 // ['_det_lu_based_helper']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_378_t)(const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_397_t)(const Tensor &, c10::optional<int64_t>);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_378_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &>(
-  batch_rule_378_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_397_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &>(
+  batch_rule_397_t batch_rule,
   const Tensor & self
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8261,10 +8815,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_378_t,std::tuple<Te
 }
 
 // ['_det_lu_based_helper_backward_helper']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_379_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_398_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>);
 template <>
-Tensor lowerToNextLayer<batch_rule_379_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &>(
-  batch_rule_379_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_398_t,Tensor,const Tensor &, const Tensor &, const Tensor &, const Tensor &, const Tensor &>(
+  batch_rule_398_t batch_rule,
   const Tensor & det_grad, const Tensor & det, const Tensor & self, const Tensor & lu, const Tensor & pivs
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8291,10 +8845,10 @@ Tensor lowerToNextLayer<batch_rule_379_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['linalg_lstsq']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_380_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<double>, c10::optional<c10::string_view>);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_399_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<double>, c10::optional<c10::string_view>);
 template <>
-std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_380_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, c10::optional<double>, c10::optional<c10::string_view>>(
-  batch_rule_380_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_399_t,std::tuple<Tensor,Tensor,Tensor,Tensor>,const Tensor &, const Tensor &, c10::optional<double>, c10::optional<c10::string_view>>(
+  batch_rule_399_t batch_rule,
   const Tensor & self, const Tensor & b, c10::optional<double> rcond, c10::optional<c10::string_view> driver
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8312,10 +8866,10 @@ std::tuple<Tensor,Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_380_t,std::t
 }
 
 // ['linalg_eigh', 'linalg_qr', '_linalg_qr_helper']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_381_t)(const Tensor &, c10::optional<int64_t>, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_400_t)(const Tensor &, c10::optional<int64_t>, c10::string_view);
 template <>
-std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_381_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::string_view>(
-  batch_rule_381_t batch_rule,
+std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_400_t,std::tuple<Tensor,Tensor>,const Tensor &, c10::string_view>(
+  batch_rule_400_t batch_rule,
   const Tensor & self, c10::string_view UPLO
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8330,10 +8884,10 @@ std::tuple<Tensor,Tensor> lowerToNextLayer<batch_rule_381_t,std::tuple<Tensor,Te
 }
 
 // ['linalg_eigvalsh', 'linalg_cond.p_str']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_382_t)(const Tensor &, c10::optional<int64_t>, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_401_t)(const Tensor &, c10::optional<int64_t>, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_382_t,Tensor,const Tensor &, c10::string_view>(
-  batch_rule_382_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_401_t,Tensor,const Tensor &, c10::string_view>(
+  batch_rule_401_t batch_rule,
   const Tensor & self, c10::string_view UPLO
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8348,10 +8902,10 @@ Tensor lowerToNextLayer<batch_rule_382_t,Tensor,const Tensor &, c10::string_view
 }
 
 // ['linalg_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_383_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_402_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_383_t,Tensor,const Tensor &, const c10::optional<Scalar> &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>>(
-  batch_rule_383_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_402_t,Tensor,const Tensor &, const c10::optional<Scalar> &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>>(
+  batch_rule_402_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & ord, c10::optional<IntArrayRef> dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8366,10 +8920,10 @@ Tensor lowerToNextLayer<batch_rule_383_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['linalg_norm.ord_str']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_384_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_403_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_384_t,Tensor,const Tensor &, c10::string_view, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>>(
-  batch_rule_384_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_403_t,Tensor,const Tensor &, c10::string_view, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>>(
+  batch_rule_403_t batch_rule,
   const Tensor & self, c10::string_view ord, c10::optional<IntArrayRef> dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8384,10 +8938,10 @@ Tensor lowerToNextLayer<batch_rule_384_t,Tensor,const Tensor &, c10::string_view
 }
 
 // ['linalg_vector_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_385_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_404_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_385_t,Tensor,const Tensor &, const Scalar &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>>(
-  batch_rule_385_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_404_t,Tensor,const Tensor &, const Scalar &, c10::optional<IntArrayRef>, bool, c10::optional<ScalarType>>(
+  batch_rule_404_t batch_rule,
   const Tensor & self, const Scalar & ord, c10::optional<IntArrayRef> dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8402,10 +8956,10 @@ Tensor lowerToNextLayer<batch_rule_385_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['linalg_matrix_norm']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_386_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, IntArrayRef, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_405_t)(const Tensor &, c10::optional<int64_t>, const Scalar &, IntArrayRef, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_386_t,Tensor,const Tensor &, const Scalar &, IntArrayRef, bool, c10::optional<ScalarType>>(
-  batch_rule_386_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_405_t,Tensor,const Tensor &, const Scalar &, IntArrayRef, bool, c10::optional<ScalarType>>(
+  batch_rule_405_t batch_rule,
   const Tensor & self, const Scalar & ord, IntArrayRef dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8420,10 +8974,10 @@ Tensor lowerToNextLayer<batch_rule_386_t,Tensor,const Tensor &, const Scalar &,
 }
 
 // ['linalg_matrix_norm.str_ord']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_387_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, IntArrayRef, bool, c10::optional<ScalarType>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_406_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, IntArrayRef, bool, c10::optional<ScalarType>);
 template <>
-Tensor lowerToNextLayer<batch_rule_387_t,Tensor,const Tensor &, c10::string_view, IntArrayRef, bool, c10::optional<ScalarType>>(
-  batch_rule_387_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_406_t,Tensor,const Tensor &, c10::string_view, IntArrayRef, bool, c10::optional<ScalarType>>(
+  batch_rule_406_t batch_rule,
   const Tensor & self, c10::string_view ord, IntArrayRef dim, bool keepdim, c10::optional<ScalarType> dtype
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8438,10 +8992,10 @@ Tensor lowerToNextLayer<batch_rule_387_t,Tensor,const Tensor &, c10::string_view
 }
 
 // ['linalg_svd']
-typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_388_t)(const Tensor &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>,Tensor,c10::optional<int64_t>> (*batch_rule_407_t)(const Tensor &, c10::optional<int64_t>, bool);
 template <>
-std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_388_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool>(
-  batch_rule_388_t batch_rule,
+std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_407_t,std::tuple<Tensor,Tensor,Tensor>,const Tensor &, bool>(
+  batch_rule_407_t batch_rule,
   const Tensor & self, bool full_matrices
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8456,10 +9010,10 @@ std::tuple<Tensor,Tensor,Tensor> lowerToNextLayer<batch_rule_388_t,std::tuple<Te
 }
 
 // ['linalg_cond']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_389_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_408_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Scalar> &);
 template <>
-Tensor lowerToNextLayer<batch_rule_389_t,Tensor,const Tensor &, const c10::optional<Scalar> &>(
-  batch_rule_389_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_408_t,Tensor,const Tensor &, const c10::optional<Scalar> &>(
+  batch_rule_408_t batch_rule,
   const Tensor & self, const c10::optional<Scalar> & p
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8474,10 +9028,10 @@ Tensor lowerToNextLayer<batch_rule_389_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['linalg_pinv.atol_rtol_tensor', 'linalg_matrix_rank.atol_rtol_tensor']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_390_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_409_t)(const Tensor &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_390_t,Tensor,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool>(
-  batch_rule_390_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_409_t,Tensor,const Tensor &, const c10::optional<Tensor> &, const c10::optional<Tensor> &, bool>(
+  batch_rule_409_t batch_rule,
   const Tensor & self, const c10::optional<Tensor> & atol, const c10::optional<Tensor> & rtol, bool hermitian
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8502,10 +9056,10 @@ Tensor lowerToNextLayer<batch_rule_390_t,Tensor,const Tensor &, const c10::optio
 }
 
 // ['linalg_pinv.atol_rtol_float', 'linalg_matrix_rank.atol_rtol_float']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_391_t)(const Tensor &, c10::optional<int64_t>, c10::optional<double>, c10::optional<double>, bool);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_410_t)(const Tensor &, c10::optional<int64_t>, c10::optional<double>, c10::optional<double>, bool);
 template <>
-Tensor lowerToNextLayer<batch_rule_391_t,Tensor,const Tensor &, c10::optional<double>, c10::optional<double>, bool>(
-  batch_rule_391_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_410_t,Tensor,const Tensor &, c10::optional<double>, c10::optional<double>, bool>(
+  batch_rule_410_t batch_rule,
   const Tensor & self, c10::optional<double> atol, c10::optional<double> rtol, bool hermitian
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8520,10 +9074,10 @@ Tensor lowerToNextLayer<batch_rule_391_t,Tensor,const Tensor &, c10::optional<do
 }
 
 // ['linalg_tensorsolve']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_392_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_411_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::optional<IntArrayRef>);
 template <>
-Tensor lowerToNextLayer<batch_rule_392_t,Tensor,const Tensor &, const Tensor &, c10::optional<IntArrayRef>>(
-  batch_rule_392_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_411_t,Tensor,const Tensor &, const Tensor &, c10::optional<IntArrayRef>>(
+  batch_rule_411_t batch_rule,
   const Tensor & self, const Tensor & other, c10::optional<IntArrayRef> dims
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8541,10 +9095,10 @@ Tensor lowerToNextLayer<batch_rule_392_t,Tensor,const Tensor &, const Tensor &,
 }
 
 // ['_test_optional_floatlist']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_393_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ArrayRef<double>>);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_412_t)(const Tensor &, c10::optional<int64_t>, c10::optional<ArrayRef<double>>);
 template <>
-Tensor lowerToNextLayer<batch_rule_393_t,Tensor,const Tensor &, c10::optional<ArrayRef<double>>>(
-  batch_rule_393_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_412_t,Tensor,const Tensor &, c10::optional<ArrayRef<double>>>(
+  batch_rule_412_t batch_rule,
   const Tensor & values, c10::optional<ArrayRef<double>> addends
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8559,10 +9113,10 @@ Tensor lowerToNextLayer<batch_rule_393_t,Tensor,const Tensor &, c10::optional<Ar
 }
 
 // ['_test_string_default']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_394_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_413_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_394_t,Tensor,const Tensor &, c10::string_view, c10::string_view>(
-  batch_rule_394_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_413_t,Tensor,const Tensor &, c10::string_view, c10::string_view>(
+  batch_rule_413_t batch_rule,
   const Tensor & dummy, c10::string_view a, c10::string_view b
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8577,10 +9131,10 @@ Tensor lowerToNextLayer<batch_rule_394_t,Tensor,const Tensor &, c10::string_view
 }
 
 // ['_test_ambiguous_defaults.b']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_395_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::string_view);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_414_t)(const Tensor &, c10::optional<int64_t>, int64_t, c10::string_view);
 template <>
-Tensor lowerToNextLayer<batch_rule_395_t,Tensor,const Tensor &, int64_t, c10::string_view>(
-  batch_rule_395_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_414_t,Tensor,const Tensor &, int64_t, c10::string_view>(
+  batch_rule_414_t batch_rule,
   const Tensor & dummy, int64_t a, c10::string_view b
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8595,10 +9149,10 @@ Tensor lowerToNextLayer<batch_rule_395_t,Tensor,const Tensor &, int64_t, c10::st
 }
 
 // ['segment_reduce']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_396_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, bool, const c10::optional<Scalar> &);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_415_t)(const Tensor &, c10::optional<int64_t>, c10::string_view, const c10::optional<Tensor> &, c10::optional<int64_t>, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t, bool, const c10::optional<Scalar> &);
 template <>
-Tensor lowerToNextLayer<batch_rule_396_t,Tensor,const Tensor &, c10::string_view, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t, bool, const c10::optional<Scalar> &>(
-  batch_rule_396_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_415_t,Tensor,const Tensor &, c10::string_view, const c10::optional<Tensor> &, const c10::optional<Tensor> &, int64_t, bool, const c10::optional<Scalar> &>(
+  batch_rule_415_t batch_rule,
   const Tensor & data, c10::string_view reduce, const c10::optional<Tensor> & lengths, const c10::optional<Tensor> & indices, int64_t axis, bool unsafe, const c10::optional<Scalar> & initial
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);
@@ -8623,10 +9177,10 @@ Tensor lowerToNextLayer<batch_rule_396_t,Tensor,const Tensor &, c10::string_view
 }
 
 // ['_segment_reduce_backward']
-typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_397_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::string_view, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
+typedef std::tuple<Tensor,c10::optional<int64_t>> (*batch_rule_416_t)(const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, const Tensor &, c10::optional<int64_t>, c10::string_view, const c10::optional<Tensor> &, c10::optional<int64_t>, int64_t);
 template <>
-Tensor lowerToNextLayer<batch_rule_397_t,Tensor,const Tensor &, const Tensor &, const Tensor &, c10::string_view, const c10::optional<Tensor> &, int64_t>(
-  batch_rule_397_t batch_rule,
+Tensor lowerToNextLayer<batch_rule_416_t,Tensor,const Tensor &, const Tensor &, const Tensor &, c10::string_view, const c10::optional<Tensor> &, int64_t>(
+  batch_rule_416_t batch_rule,
   const Tensor & grad, const Tensor & output, const Tensor & data, c10::string_view reduce, const c10::optional<Tensor> & lengths, int64_t axis
 ) {
   c10::impl::ExcludeDispatchKeyGuard guard(kBatchedKey);


Test patch:
diff --git a/test/test_ops.py b/test/test_ops.py
index 428c30516..c46d23fea 100644
--- a/test/test_ops.py
+++ b/test/test_ops.py
@@ -512,7 +512,7 @@ def test_vmapvjp(self, device, dtype, op):
         xfail('linalg.eigvalsh'),
 
         # functorch doesn't support channels_last
-        # PyTorch core's vmap doesn't have a batching rule for `double`, if it 
+        # PyTorch core's vmap doesn't have a batching rule for `double`, if it
         # did it would also not support channels last, so I'm including this
         # xfail "above the line".
         xfail('double', 'channels_last'),
@@ -620,7 +620,6 @@ def test_vmapjvp(self, device, dtype, op):
         xfail('nanquantile'),
         xfail('nn.functional.conv_transpose2d'),
         xfail('nn.functional.gelu'),
-        xfail('nn.functional.grid_sample'),
         xfail('nn.functional.pad', 'circular'),
         xfail('norm', 'fro'),
         xfail('norm', 'inf'),