class_docstr: Information retrieval model which jointly encodes both query and passage
  and passes them to BERT encoder followed by a fully-connected layer for
  similarity score prediction.
class_docstr_tok: ["Information","retrieval","model","which","jointly","encodes","both","query","and","passage","and","passes","them","to","BERT","encoder","followed","by","a","fully-connected","layer","for","similarity","score","prediction","."]
code: def compute_scores_and_loss(self, inputs):
      input_ids, input_mask, input_type_ids = inputs
      batch_size, num_passages, seq_length = input_ids.size()
  
      unnormalized_scores = self(
          input_ids=input_ids.view(-1, seq_length),
          attention_mask=input_mask.view(-1, seq_length),
          token_type_ids=input_type_ids.view(-1, seq_length),
      ).view(batch_size, 1, num_passages)
      scores = torch.log_softmax(unnormalized_scores, dim=-1)
  
      labels = torch.zeros_like(input_ids[:, :1, 0])
      loss = self.loss(
          log_probs=scores,
          labels=labels,
          output_mask=torch.ones_like(labels),
      )
  
      return unnormalized_scores[:, 0], loss
  
file_path: NeMo/nemo/collections/nlp/models/information_retrieval/bert_joint_ir_model.py
imports: from typing import Dict, Optional
  import torch
  from omegaconf import DictConfig
  from pytorch_lightning import Trainer
  from nemo.collections.common.losses import SmoothedCrossEntropyLoss
  from nemo.collections.nlp.models.information_retrieval.base_ir_model import BaseIRModel
  from nemo.collections.nlp.modules.common import SequenceRegression
  from nemo.collections.nlp.modules.common.tokenizer_utils import get_tokenizer
  from nemo.core.classes.common import typecheck
  from nemo.core.neural_types import NeuralType
label_desc: Use image node_id 5 for calling the BertJointIRModel obj's underlying member method code with example usage: obj.compute_scores_and_loss(inputs) and returns: unnormalized_scores,  loss