code: def test_temperature(self):
      inputs = torch.rand(2, 2)
  
      model_with_temp = self._get_test_model(2, 2, 10)
      model_with_no_temp = self._get_test_model(2, 2, 1)
      self._tie_test_model_weights(model_with_temp, model_with_no_temp)
  
      # check logits are not temp scaled during training
  
      model_with_temp.train()
      model_with_no_temp.train()
  
      temp_logits = model_with_temp(inputs)
      no_temp_logits = model_with_no_temp(inputs)
  
      for model in (model_with_temp, model_with_no_temp):
          self.assertTrue(model.training)
  
      self.assertTrue(torch.equal(no_temp_logits, temp_logits))
  
      # check logits are temp scaled during testing
  
      model_with_temp.eval()
      model_with_no_temp.eval()
  
      temp_logits = model_with_temp(inputs)
      no_temp_logits = model_with_no_temp(inputs)
  
      for model in (model_with_temp, model_with_no_temp):
          self.assertFalse(model.training)
  
      self.assertFalse(
          any(self._check_logits_equality(no_temp_logits, temp_logits))
      )
      self.assertTrue(
          all(
              self._check_logits_equality(
                  no_temp_logits, temp_logits * 10
              )
          )
      )
  
file_path: pytext/pytext/models/test/mlp_decoder_test.py
imports: import unittest
  import torch
  import torch.nn
  from pytext.models.decoders.mlp_decoder import MLPDecoder
label_desc: Use image node_id 4 for calling the MLPDecoderTest obj's underlying member method code with example usage: obj.test_temperature() without return types