code: def test_compute_loss_unimodal(unimodal_model, dataset):
      """Test if the loss computation for a single loss function matches the expectation."""
      y_true = dataset["output"]["unimodal"]["y_true"]
      y_pred = dataset["output"]["unimodal"]["y_pred"]
  
      loss_val, _ = unimodal_model.compute_loss(
          y_pred=y_pred, y_true=y_true
      )
      expected_loss_val = loss_fn(input=y_pred, target=y_true).item()
      assert np.allclose(loss_val, expected_loss_val)
  
imports: from typing import List
  import numpy
  import pytest
  import torch
  import torch.nn
  import torch.optim
  from torch.utils.data import DataLoader, TensorDataset
  from alibi.models.pytorch.metrics import AccuracyMetric, LossContainer
  from alibi.models.pytorch.model import Model
label_desc: Use image node_id 11 for calling a global function with example usage: test_compute_loss_unimodal(unimodal_model, dataset) without return types