code: def activations_hlsmodel(model, X, fmt="summary", plot="boxplot"):
      if fmt == "longform":
          raise NotImplementedError
      elif fmt == "summary":
          data = []
  
      _, trace = model.trace(np.ascontiguousarray(X))
  
      if len(trace) == 0:
          raise RuntimeError(
              "ModelGraph must have tracing on for at least 1 layer (this can be set in its config)"
          )
  
      for layer in trace.keys():
          print(f"   {layer}")
  
          if fmt == "summary":
              y = trace[layer].flatten()
              y = abs(y[y != 0])
  
              if len(y) == 0:
                  print(
                      f"Activations for {layer} are only zeros, ignoring."
                  )
                  continue
  
              data.append(array_to_summary(y, fmt=plot))
              data[-1]["weight"] = layer
  
      return data
  
imports: import json
  import os
  import shutil
  import uuid
  from collections import defaultdict
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from hls4ml.model.graph import ModelGraph
  from hls4ml.model.layers import GRU, LSTM, SeparableConv1D, SeparableConv2D
label_desc: Use image node_id 14 for calling a global function with example usage: activations_hlsmodel(model, X, fmt, plot) and returns: data