code: def multimodal_model(request):
      """Creates and optionally compiles a multi-modal output model."""
      model = MultimodalModel(
          input_dim=request.param["input_dim"],
          output_dims=request.param["output_dims"],
      )
  
      if request.param.get("compile", False):
          model.compile(
              optimizer=request.param["optimizer"](
                  model.parameters(), lr=lr
              ),
              loss=request.param["loss"],
              loss_weights=request.param["loss_weights"],
              metrics=request.param.get("metrics", None),
          )
  
      return model
  
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 3 for calling a global function with example usage: multimodal_model(request) and returns: model