code: def test_mnist_cnn(
      keras_model, mnist_data, backend, io_type, strategy
  ):
      x_train, y_train, x_test, y_test = mnist_data
  
      hls_config = hls4ml.utils.config_from_keras_model(
          keras_model, granularity="name", backend=backend
      )
      hls_config["Model"]["Strategy"] = strategy
      hls_config["LayerName"]["softmax"]["Implementation"] = "stable"
      output_dir = str(
          test_root_path
          / f"hls4mlprj_cnn_mnist_{backend}_{io_type}_{strategy}"
      )
  
      hls_model = hls4ml.converters.convert_from_keras_model(
          keras_model,
          hls_config=hls_config,
          output_dir=output_dir,
          backend=backend,
          io_type=io_type,
      )
      hls_model.compile()
  
      # Model under test predictions and accuracy
      y_keras = keras_model.predict(x_test)
      y_hls4ml = hls_model.predict(x_test)
  
      acc_keras = accuracy_score(
          np.argmax(y_test, axis=1), np.argmax(y_keras, axis=1)
      )
      acc_hls4ml = accuracy_score(
          np.argmax(y_test, axis=1), np.argmax(y_hls4ml, axis=1)
      )
      rel_diff = abs(acc_keras - acc_hls4ml) / acc_keras
  
      print(f"Accuracy keras:      {acc_keras}")
      print(f"Accuracy hls4ml:     {acc_hls4ml}")
      print(f"Relative difference: {rel_diff}")
  
      assert acc_keras > 0.95 and rel_diff < 0.03
  
file_path: hls4ml/test/pytest/test_cnn_mnist.py
imports: from pathlib import Path
  import numpy
  import pytest
  from sklearn.metrics import accuracy_score
  from tensorflow.keras.datasets import mnist
  from tensorflow.keras.layers import Activation, AveragePooling2D, Conv2D, Dense, Flatten, MaxPooling2D
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.utils import to_categorical
  import hls4ml
label_desc: Use image node_id 3 for calling a global function with example usage: test_mnist_cnn(keras_model, mnist_data, backend, io_type, strategy) without return types