code: def dict2dict(tokens, dict2dict_map):
      if tokens.device == torch.device("cpu"):
          tokens_tmp = tokens
      else:
          tokens_tmp = tokens.cpu()
      return tokens_tmp.map_(
          tokens_tmp,
          lambda _, val, dict2dict_map=dict2dict_map: dict2dict_map[
              float(val)
          ],
      ).to(tokens.device)
  
file_path: fairseq/examples/fast_noisy_channel/noisy_channel_sequence_generator.py
imports: from typing import Dict, List, Optional
  import math
  import numpy
  import torch
  import torch.nn.functional
  from torch import Tensor
  from .noisy_channel_beam_search import NoisyChannelBeamSearch
  from fairseq.sequence_generator import EnsembleModel
label_desc: Use image node_id 3 for calling a global function with example usage: dict2dict(tokens, dict2dict_map) and returns: tokens_tmp