class_docstr: ## Sampler with Temperature
class_docstr_tok: ["#","#","Sampler","with","Temperature"]
docstr: :param temperature: is the temperature to sample with
docstr_tok: [":","param","temperature",":","is","the","temperature","to","sample","with"]
code: def __init__(self, temperature: float = 1.0):
      """
      :param temperature: is the temperature to sample with
      """
      self.temperature = temperature
  
imports: import torch
  from torch.distributions import Categorical
  from labml_nn.sampling import Sampler
label_desc: Use image node_id 1 to create a new TemperatureSampler object from inherited base classes: Sampler with example: obj = TemperatureSampler(temperature)