code: def compute_sims(inputs: pt.Tensor, normalize: bool) -> pt.Tensor:
      """
      Returns a matrix with pair-wise similarity scores between inputs.
      Similarity score is (normalized) Euclidean distance. 'Similarity with self' is masked
      to large negative value.
  
      :param inputs: tensor of inputs.
      :param normalize: Whether to normalize to unit-length.
      :return: tensor with pairwise similarities of same shape as inputs.
      """
      if normalize:
          logger.info("Normalizing embeddings to unit length")
          inputs = inputs / pt.linalg.norm(inputs, dim=-1, keepdim=True)
      sims = pt.mm(inputs, inputs.transpose(0, 1))
      sims.fill_diagonal_(-9999999.0)
      return sims
  
file_path: sockeye/sockeye/embeddings.py
imports: import argparse
  import logging
  import sys
  from typing import Iterable, Tuple
  import torch
  import sockeye.constants
  from .None import model
  from .None import utils
  from .data_io import tokens2ids
  from .log import setup_main_logger
  from .utils import check_condition
  from .vocab import reverse_vocab
label_desc: Use image node_id 1 for calling a global function with example usage: compute_sims(inputs, normalize) and returns: sims