docstr: :param model: SentenceTransformer model
docstr_tok: [":","param","model",":","SentenceTransformer","model"]
code: def __init__(
      self,
      model: SentenceTransformer,
      scale: float = 20.0,
      similarity_fct=util.cos_sim,
  ):
      """
      :param model: SentenceTransformer model
      """
      super(ContrastiveTensionLossInBatchNegatives, self).__init__()
      self.model2 = model  # This will be the final model used during the inference time.
      self.model1 = copy.deepcopy(model)
      self.similarity_fct = similarity_fct
      self.cross_entropy_loss = nn.CrossEntropyLoss()
      # self.scale = scale
      self.logit_scale = nn.Parameter(torch.ones([]) * np.log(scale))
  
imports: import torch
  from torch import nn, Tensor
  from typing import Iterable, Dict
  from ..SentenceTransformer import SentenceTransformer
  from ..None import util
  import copy
  import random
  import math
  from ..None import InputExample
  import numpy
label_desc: Use image node_id 1 to create a new ContrastiveTensionLossInBatchNegatives object from inherited base classes: nn with example: obj = ContrastiveTensionLossInBatchNegatives(model, scale, similarity_fct)