code: def gamma(
      alpha: Union[float, torch.Tensor],
      beta: Union[float, torch.Tensor],
      /,
      *,
      shape: Optional[Union[ivy.NativeShape, Sequence[int]]] = None,
      dtype: Optional[Union[torch.dtype, ivy.Dtype]] = None,
      device: torch.device = None,
      seed: Optional[int] = None,
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      shape = _check_bounds_and_get_shape(alpha, beta, shape).shape
      if seed is not None:
          torch.manual_seed(seed)
      ret = torch.distributions.gamma.Gamma(alpha, beta).sample(shape)
      if device is not None:
          return ret.to(device)
      return ret
  
file_path: ivy/ivy/functional/backends/torch/experimental/random.py
imports: from typing import Optional, Union, Sequence
  import torch
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ..None import backend_version
  from ivy.functional.ivy.random import _check_bounds_and_get_shape, _check_shapes_broadcastable
label_desc: Use image node_id 3 for calling a global function with example usage: gamma() and returns: ret, ret