code: def gamma(shape, alpha, dtype=None, seed=None):
      dtype = dtype or floatx()
      dtype = to_torch_dtype(dtype)
      alpha = torch.broadcast_to(convert_to_tensor(alpha), shape)
      beta = torch.ones(shape, device=get_device())
      prev_rng_state = torch.random.get_rng_state()
      first_seed, second_seed = draw_seed(seed)
      torch.manual_seed(first_seed + second_seed)
      gamma_distribution = torch.distributions.gamma.Gamma(alpha, beta)
      sample = gamma_distribution.sample().type(dtype)
      torch.random.set_rng_state(prev_rng_state)
      return sample
  
imports: import torch
  import torch._dynamo
  import torch.nn.functional
  from keras.backend.config import floatx
  from keras.backend.torch.core import convert_to_tensor
  from keras.backend.torch.core import get_device
  from keras.backend.torch.core import to_torch_dtype
  from keras.random.seed_generator import SeedGenerator
  from keras.random.seed_generator import draw_seed
  from keras.random.seed_generator import make_default_seed
label_desc: Use image node_id 10 for calling a global function with example usage: gamma(shape, alpha, dtype, seed) and returns: sample