code: def get_similarity(
      text_features: torch.Tensor,
      visual_features: torch.Tensor,
      num_text_augs: int,
      norm: bool = False,
  ) -> torch.Tensor:
      if norm:
          text_features /= text_features.norm(dim=-1, keepdim=True)
          visual_features /= visual_features.norm(dim=-1, keepdim=True)
      similarity = 100.0 * text_features @ visual_features.T
      similarity = similarity.view(
          visual_features.size(0), num_text_augs, -1
      ).softmax(dim=-1)
      similarity = similarity.mean(dim=1, keepdim=False)
      return similarity
  
imports: from collections import OrderedDict
  from typing import Dict
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: get_similarity(text_features, visual_features, num_text_augs, norm) and returns: similarity