    def evaluate_step(self, model: nn.Module, inputs: Any) -> dict:
        """
        One batch step when evaluating.

        Args:
            model (`nn.Module`):
                Pytorch model.
            inputs (`Any`):
                Input Tensor or any kind of collection made up by tensors.

        Returns:
            (`dict`)
                Evaluate logs dict.
        """
        inputs = self.prepare_inputs(inputs)
        step_loss = self.compute_loss(model, inputs)
        step_loss = reduce_value(step_loss, average=True)
        step_loss = step_loss.detach()

        loss_metric, epoch_metric = self.update_metrics(model, inputs, step_loss, training=False)

        step_logs = {"eval_step_loss": step_loss.item(), "eval_epoch_loss": loss_metric,
                     "eval_epoch_metric": epoch_metric}
        return step_logs
One batch step when evaluating.

Args:
model (`nn.Module`):
Pytorch model.
inputs (`Any`):
Input Tensor or any kind of collection made up by tensors.

Returns:
(`dict`)
Evaluate logs dict.
towhee/trainer/trainer.py