code: def hls_model(keras_model, backend, io_type, strategy):
      default_precision = (
          "ap_fixed<16,3,AP_RND_CONV,AP_SAT>"
          if backend == "Vivado"
          else "ac_fixed<16,3,true,AC_RND_CONV,AC_SAT>"
      )
      fc1_weight_precision = (
          "ap_fixed<16,3>"
          if backend == "Vivado"
          else "ac_fixed<16,3,true>"
      )
      fc1_result_precision = (
          "ap_fixed<16,6,AP_RND_CONV,AP_SAT>"
          if backend == "Vivado"
          else "ac_fixed<16,6,true,AC_RND_CONV,AC_SAT>"
      )
      output_softmax_weight_precision = (
          "ap_fixed<16,6>"
          if backend == "Vivado"
          else "ac_fixed<16,6,true>"
      )
      output_softmax_result_precision = (
          "ap_fixed<16,6,AP_RND_CONV,AP_SAT>"
          if backend == "Vivado"
          else "ac_fixed<16,6,true,AP_RND_CONV,AP_SAT>"
      )
  
      # Default config
      hls_config = hls4ml.utils.config_from_keras_model(keras_model)
      hls_config["Model"]["Strategy"] = strategy
      hls_config["Model"]["ReuseFactor"] = 1
      hls_config["Model"]["Precision"] = default_precision
  
      # Some model-specific precision tuning
      hls_config["LayerName"] = {}
      hls_config["LayerName"]["fc1_relu"] = {
          "Precision": {
              "weight": fc1_weight_precision,
              "result": fc1_result_precision,
          }
      }
      hls_config["LayerName"]["output_softmax"] = {
          "Precision": {
              "weight": output_softmax_weight_precision,
              "result": output_softmax_result_precision,
          }
      }
      hls_config["LayerName"]["output_softmax_softmax"] = {
          "Strategy": "Stable"
      }
  
      output_dir = str(
          test_root_path
          / f"hls4mlprj_conv1d_{backend}_{io_type}_{strategy}"
      )
      hls_model = hls4ml.converters.convert_from_keras_model(
          keras_model,
          hls_config=hls_config,
          backend=backend,
          io_type=io_type,
          output_dir=output_dir,
      )
      hls_model.compile()
      return hls_model
  
file_path: hls4ml/test/pytest/test_conv1d.py
imports: from pathlib import Path
  import numpy
  import pytest
  from sklearn.metrics import accuracy_score
  from tensorflow.keras.models import model_from_json
  import hls4ml
label_desc: Use image node_id 3 for calling a global function with example usage: hls_model(keras_model, backend, io_type, strategy) and returns: hls_model