class_docstr: Implements temperature scaling of logits. Based on results from "On Calibration of Modern Neural Networks":
  https://arxiv.org/abs/1706.04599. Temperature scaling scales all logits by the same constant factor. Though it
  may modify output probabilities it will never change argmax or categorical top-n predictions. In the case of
  binary classification with a threshold, however, calibration may change predictions.
  
  Implementation inspired by https://github.com/gpleiss/temperature_scaling
  
  Args:
      num_classes: The number of classes. Must be 2 if binary is True.
      binary: If binary is true, logits is expected to be a 1-dimensional array. If false, logits is a 2-dimensional
              array of shape (num_examples, num_classes).
class_docstr_tok: ["Implements","temperature","scaling","of","logits",".","Based","on","results","from","``","On","Calibration","of","Modern","Neural","Networks","''",":","https",":","\/\/arxiv.org\/abs\/1706.04599",".","Temperature","scaling","scales","all","logits","by","the","same","constant","factor",".","Though","it","may","modify","output","probabilities","it","will","never","change","argmax","or","categorical","top-n","predictions",".","In","the","case","of","binary","classification","with","a","threshold",",","however",",","calibration","may","change","predictions",".","Implementation","inspired","by","https",":","\/\/github.com\/gpleiss\/temperature_scaling","Args",":","num_classes",":","The","number","of","classes",".","Must","be","2","if","binary","is","True",".","binary",":","If","binary","is","true",",","logits","is","expected","to","be","a","1-dimensional","array",".","If","false",",","logits","is","a","2-dimensional","array","of","shape","(","num_examples",",","num_classes",")","."]
code: def scale_logits(self, logits: torch.Tensor) -> torch.Tensor:
      return torch.div(logits, self.temperature)
  
imports: import logging
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import List, Type, Union
  import numpy
  import torch
  import torch.nn
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import BINARY, CATEGORY
  from ludwig.utils.registry import DEFAULT_KEYS, Registry
label_desc: Use image node_id 3 for calling the TemperatureScaling obj's underlying member method code with example usage: obj.scale_logits(logits) and returns: torch