code: def embedding(
      input,
      weight,
      padding_idx=None,
      max_norm=None,
      norm_type=2.0,
      scale_grad_by_freq=False,
      sparse=False,
  ):
      # TODO: add support for the remaining arguments
      ivy.utils.assertions.check_equal(
          len(weight.shape),
          2,
          message="weight must be 2-d",
          as_array=False,
      )
      input = ivy.astype(input, "int64")
      if max_norm is None:
          ret = ivy.embedding(weight, input)
      else:
          if norm_type == 2.0:
              ret = ivy.embedding(weight, input, max_norm=max_norm)
          else:
              ret = ivy.embedding(weight, input, max_norm=None)
              # perform the re-norm using ivy functions
              norms = ivy.vector_norm(
                  ret, ord=norm_type, axis=-1, keepdims=True
              )
              norms = ivy.repeat(norms, ret.shape[-1], axis=-1)
              ret = ivy.where(
                  norms > max_norm, ret * max_norm / norms, ret
              )
              ret = ivy.where(
                  norms < -max_norm, ret * -max_norm / norms, ret
              )
      return ret
  
imports: import ivy
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_supported_dtypes
label_desc: Use image node_id 1 for calling a global function with example usage: embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse) and returns: ret