code: def _extract_tensor_patchesnd(
      input: Tensor,
      window_sizes: Tuple[int, ...],
      strides: Tuple[int, ...],
  ) -> Tensor:
      batch_size, num_channels = input.size()[:2]
      dims = range(2, input.dim())
      for dim, patch_size, stride in zip(dims, window_sizes, strides):
          input = input.unfold(dim, patch_size, stride)
      input = input.permute(
          0, *dims, 1, *(dim + len(dims) for dim in dims)
      ).contiguous()
      return input.view(batch_size, -1, num_channels, *window_sizes)
  
file_path: kornia/kornia/contrib/extract_patches.py
imports: import math
  from typing import Optional, Tuple, Union, cast
  import torch
  import torch.nn.functional
  from torch.nn.modules.utils import _pair
  from kornia.core import Module, Tensor, pad
label_desc: Use image node_id 3 for calling a global function with example usage: _extract_tensor_patchesnd(input, window_sizes, strides) and returns: input