class_docstr: Linear temperature scheduler to support temperature annealing in :class:`GumbelDartsLightningModule`.
  Temperature decreases from ``init`` to ``min`` linearly throughout ``total`` given in :meth:`step`.
  
  Parameters
  ----------
  init
      Initial temperature.
  min
      Minimum temperature.
class_docstr_tok: ["Linear","temperature","scheduler","to","support","temperature","annealing","in",":","class",":","`","GumbelDartsLightningModule","`",".","Temperature","decreases","from","``","init","``","to","``","min","``","linearly","throughout","``","total","``","given","in",":","meth",":","`","step","`",".","Parameters","--","--","--","--","--","init","Initial","temperature",".","min","Minimum","temperature","."]
docstr: Compute temperature for current epoch.
  
  ``current`` is 0-indexed in the range of [0, total).
  If ``total`` is not given, ``init`` must be equal to ``min``.
docstr_tok: ["Compute","temperature","for","current","epoch",".","``","current","``","is","0-indexed","in","the","range","of","[","0",",","total",")",".","If","``","total","``","is","not","given",",","``","init","``","must","be","equal","to","``","min","``","."]
code: def step(self, current: int, total: int | None = None):
      """Compute temperature for current epoch.
  
      ``current`` is 0-indexed in the range of [0, total).
      If ``total`` is not given, ``init`` must be equal to ``min``.
      """
      if total is None:
          if self.init == self.min:
              return self.min
          else:
              raise ValueError(
                  "Total epoch is None, but temperature is not fixed."
              )
      if current > total:
          _logger.warning(
              "Current epoch (%d) is larger than total epoch (%d). Assuming current = total.",
              current,
              total,
          )
          current = total
      return (1 - current / total) * (self.init - self.min) + self.min
  
imports: from __future__ import annotations
  import logging
  import pytorch_lightning
  import torch
  import torch.nn
  import torch.optim
  from .base_lightning import BaseOneShotLightningModule
  from .supermodule.differentiable import GumbelSoftmax
  from .profiler import ExpectationProfilerPenalty
label_desc: Use image node_id 2 for calling the LinearTemperatureScheduler obj's underlying member method code with example usage: obj.step(current, total) and returns: unknown, self