code: def test_prototype_probabilitiy(self) -> None:
      torch.manual_seed(0)
      queries = F.normalize(torch.rand((8, 10)), dim=1)
      prototypes = F.normalize(torch.rand((4, 10)), dim=1)
      prob = msn_loss.prototype_probabilities(
          queries, prototypes, temperature=0.5
      )
      self.assertEqual(prob.shape, (8, 4))
      self.assertLessEqual(prob.max(), 1.0)
      self.assertGreater(prob.min(), 0.0)
  
      # verify sharpening
      prob1 = msn_loss.prototype_probabilities(
          queries, prototypes, temperature=0.1
      )
      # same prototypes should be assigned regardless of temperature
      self.assertTrue(
          torch.all(prob.argmax(dim=1) == prob1.argmax(dim=1))
      )
      # probabilities of selected prototypes should be higher for lower temperature
      self.assertTrue(
          torch.all(prob.max(dim=1)[0] < prob1.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 4 for calling the TestMSNLossUnitTest obj's underlying member method code with example usage: obj.test_prototype_probabilitiy() without return types