code: def __init__(self, top_p: float) -> None:
      assert 0.0 <= top_p <= 1.0
      self.top_p = top_p
  
imports: import abc
  from typing import List, Optional
  import torch
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new TopPLogitProcessor object from inherited base classes: BaseLogitProcessor with example: obj = TopPLogitProcessor(top_p)