code: def sharpen(probabilities: Tensor, temperature: float) -> Tensor:
      """Sharpens the probabilities with the given temperature.
  
      Args:
          probabilities:
              Tensor with shape (batch_size, dim)
          temperature:
              Temperature in (0, 1]. Lower temperature results in stronger sharpening (
              output probabilities are less uniform).
      Returns:
          Probabilities tensor with shape (batch_size, dim).
  
      """
      probabilities = probabilities ** (1.0 / temperature)
      probabilities /= torch.sum(probabilities, dim=1, keepdim=True)
      return probabilities
  
file_path: lightly/lightly/loss/msn_loss.py
imports: import math
  import warnings
  from typing import Union
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: sharpen(probabilities, temperature) and returns: probabilities