code: def filter_top_k_pytorch(data, k, replace=None, ascending=False):
      _data = data.clone()
  
      filtered_data, idxes = torch.topk(_data, k)
  
      if replace:
          _data[_data < filtered_data[-1]] = replace
          return _data, idxes
  
      if ascending:
          return torch.flip(filtered_data, (0,)), torch.flip(
              idxes, (0,)
          )
      else:
          return filtered_data, idxes
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: filter_top_k_pytorch(data, k, replace, ascending) and returns: _data,  idxes, torch,  torch, filtered_data,  idxes