code: def test_sharpen(self) -> None:
      torch.manual_seed(0)
      prob = torch.rand((8, 10))
      p0 = msn_loss.sharpen(prob, temperature=0.5)
      p1 = msn_loss.sharpen(prob, temperature=0.1)
      # indices of max probabilities should be the same regardless of temperature
      self.assertTrue(torch.all(p0.argmax(dim=1) == p1.argmax(dim=1)))
      # max probabilities should be higher for lower temperature
      self.assertTrue(torch.all(p0.max(dim=1)[0] < p1.max(dim=1)[0]))
  
imports: import unittest
  from unittest import TestCase
  import pytest
  import torch
  import torch.nn.functional
  from pytest_mock import MockerFixture
  from torch import distributed
  from torch import nn
  from torch.optim import SGD
  from lightly.loss import msn_loss
  from lightly.loss.msn_loss import MSNLoss
  from lightly.models.modules.heads import MSNProjectionHead
label_desc: Use image node_id 5 for calling the TestMSNLossUnitTest obj's underlying member method code with example usage: obj.test_sharpen() without return types