code: def topk(input, k, dim=None, largest=True, sorted=True, *, out=None):
      if dim is None:
          dim = -1
      return ivy.top_k(
          input, k, axis=dim, largest=largest, sorted=sorted, out=out
      )
  
imports: import ivy
  import ivy.functional.frontends.torch
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
  from collections import namedtuple
label_desc: Use image node_id 27 for calling a global function with example usage: topk(input, k, dim, largest, sorted) and returns: ivy