code: def test_predict_batch(predict_batch_params):
      (
          model,
          batch_size,
          dtype,
          preprocess_fn,
          to_list,
      ) = predict_batch_params
      x_batch = [x] if to_list else x
      preds = predict_batch(
          x_batch,
          model,
          batch_size=batch_size,
          preprocess_fn=preprocess_fn,
          dtype=dtype,
      )
      if isinstance(preds, tuple):
          preds = preds[0]
      assert preds.dtype == dtype
      if (
          isinstance(model, nn.Sequential)
          or hasattr(model, "__name__")
          and model.__name__ == "id_fn"
      ):
          assert preds.shape == x.shape
      elif isinstance(model, nn.Module):
          assert preds.shape == (n, n_classes)
  
file_path: alibi-detect/alibi_detect/utils/pytorch/tests/test_prediction_pt.py
imports: import numpy
  import pytest
  import torch
  import torch.nn
  from typing import Tuple, Union
  from alibi_detect.utils.pytorch import predict_batch
label_desc: Use image node_id 3 for calling a global function with example usage: test_predict_batch(predict_batch_params) without return types