code: def __init__(self, tgt_dict, sampling_topk=-1, sampling_topp=-1.0):
      super().__init__(tgt_dict)
      self.sampling_topk = sampling_topk
      self.sampling_topp = sampling_topp
  
imports: import math
  from typing import List, Optional
  import torch
  import torch.nn
  from fairseq.token_generation_constraints import ConstraintState, OrderedConstraintState, UnorderedConstraintState
  from torch import Tensor
label_desc: Use image node_id 1 to create a new Sampling object from inherited base classes: Search with example: obj = Sampling(tgt_dict, sampling_topk, sampling_topp)