code: def randperm(
      n,
      *,
      generator=None,
      out=None,
      dtype=ivy.int64,
      layout=None,
      device=None,
      requires_grad=False,
      pin_memory=False,
  ):
      seed = generator.initial_seed() if generator is not None else None
      arr = ivy.arange(n, device=device, dtype=dtype)
      ret = ivy.shuffle(arr, seed=seed, out=out)
      return ret
  
file_path: ivy/ivy/functional/frontends/torch/random_sampling.py
imports: import ivy
  from ivy.func_wrapper import with_supported_dtypes
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 12 for calling a global function with example usage: randperm(n) and returns: ret