code: def test_get_hidden_layers_output(load_mnist_model, params):
      model = PyTorchModel(load_mnist_model, channel_first=True)
      X = np.random.random((32, 1, 28, 28))
      result = model.get_hidden_representations(X, **params)
      assert isinstance(result, np.ndarray), "Must be a np.ndarray"
      assert len(result.shape) == 2, "Must be a batch of 1D tensors"
      assert (
          result.shape[0] == X.shape[0]
      ), "Must have same batch size as input"
  
file_path: Quantus/tests/functions/test_pytorch_model.py
imports: from collections import OrderedDict
  from typing import Union
  import numpy
  import pytest
  import torch
  from pytest_lazyfixture import lazy_fixture
  from scipy.special import softmax
  from quantus.helpers.model.pytorch_model import PyTorchModel
label_desc: Use image node_id 8 for calling a global function with example usage: test_get_hidden_layers_output(load_mnist_model, params) without return types