class_docstr: Generate Jigsaw permutation indices for a batch of inputs.
  
  Args:
      grid: the Jigsaw puzzle grid. e.g. (2, 2) means
          each output will mix image patches in a 2x2 grid.
  
  Returns:
      A dict of parameters to be passed for transformation.
          - permutation (Tensor): Jigsaw permutation arrangement.
  
  Note:
      The generated random numbers are not reproducible across different devices and dtypes. By default,
      the parameters will be generated on CPU in float32. This can be changed by calling
      ``self.set_rng_device_and_dtype(device="cuda", dtype=torch.float64)``.
code: def forward(
      self, batch_shape: Tuple[int, ...], same_on_batch: bool = False
  ) -> Dict[str, torch.Tensor]:
      batch_size = batch_shape[0]
      _common_param_check(batch_size, same_on_batch)
  
      perm_times = self.grid[0] * self.grid[1]
      # Generate mosiac order in one shot
      if batch_size == 0:
          rand_ids = torch.zeros([0, perm_times], device=self._device)
      elif same_on_batch:
          rand_ids = randperm(
              perm_times,
              ensure_perm=self.ensure_perm,
              device=self._device,
          )
          rand_ids = torch.stack([rand_ids] * batch_size)
      else:
          rand_ids = torch.stack(
              [
                  randperm(
                      perm_times,
                      ensure_perm=self.ensure_perm,
                      device=self._device,
                  )
                  for _ in range(batch_size)
              ]
          )
      return {"permutation": rand_ids}
  
file_path: kornia/kornia/augmentation/random_generator/_2d/jigsaw.py
imports: from typing import Dict, Tuple
  import torch
  from kornia.augmentation.random_generator.base import RandomGeneratorBase
  from kornia.augmentation.random_generator.utils import randperm
  from kornia.augmentation.utils import _common_param_check
label_desc: Use image node_id 4 for calling the JigsawGenerator obj's underlying member method code with example usage: obj.forward(batch_shape, same_on_batch) and returns: dict