docstr: Custom test step using the `compute_loss` method.
  
  Args:
  inputs: A data structure of tensors: raw inputs to the model. These will
      usually contain labels and weights as well as features.
  
  Returns:
  metrics: A dict of loss tensors of metrics names.
docstr_tok: ["Custom","test","step","using","the","`","compute_loss","`","method",".","Args",":","inputs",":","A","data","structure","of","tensors",":","raw","inputs","to","the","model",".","These","will","usually","contain","labels","and","weights","as","well","as","features",".","Returns",":","metrics",":","A","dict","of","loss","tensors","of","metrics","names","."]
code: def test_step(self, inputs) -> Dict[str, tf.Tensor]:
      """
      Custom test step using the `compute_loss` method.
  
      Args:
      inputs: A data structure of tensors: raw inputs to the model. These will
          usually contain labels and weights as well as features.
  
      Returns:
      metrics: A dict of loss tensors of metrics names.
      """
  
      # unscaled test loss
      loss = self.model.compute_loss(inputs, training=False)
  
      # Handle regularization losses as well.
      regularization_loss = sum(self.model.losses)
  
      total_loss = loss + regularization_loss
  
      metrics = {
          metric.name: metric.result() for metric in self.metrics
      }
      metrics["loss"] = loss
      metrics["regularization_loss"] = regularization_loss
      metrics["total_loss"] = total_loss
  
      return metrics
  
file_path: BigDL/python/friesian/src/bigdl/friesian/models/tfrs_model.py
imports: from turtle import Turtle
  import tensorflow
  import warnings
  import tensorflow_recommenders
  from tensorflow_recommenders.tasks import base
  from bigdl.dllib.utils import log4Error
  from typing import Dict
label_desc: Use image node_id 4 for calling the TFRSModel obj's underlying member method code with example usage: obj.test_step(inputs) and returns: metrics