class_docstr: The ModelGraph represents the network that is being processed by hls4ml.
  
  Args:
      config (dict):  The configuration dictionary
      layer_list (list(dict)):  The list contains a dictionary for each input layer
      inputs (list, optional):  The inputs to the model. If None, determined from layer_list
      outputs (list, optional):  The outputs to the model. If None, determined from layer_list
code: def _compute_n_samples(self, x):
      if len(self.get_input_variables()) == 1:
          xlist = [x]
      else:
          xlist = x
      n_samples = []
      for i, xi in enumerate(xlist):
          expected_size = self.get_input_variables()[i].size()
          x_size = np.prod(xi.shape)
          n_sample, rem = divmod(x_size, expected_size)
          if rem != 0:
              raise Exception(
                  f"Input size mismatch, got {x_size.shape}, expected {self.get_input_variables()[i].shape}"
              )
          n_samples.append(n_sample)
  
      if not all(
          [
              n_samples[i] == n_samples[i + 1]
              for i in range(len(xlist) - 1)
          ]
      ):
          raise Exception("Input size mismatch, not all inputs match")
  
      return int(n_sample)
  
imports: import ctypes
  import os
  import platform
  from collections import OrderedDict
  import numpy
  import numpy.ctypeslib
  from hls4ml.backends import get_backend
  from hls4ml.model.flow import get_flow
  from hls4ml.model.layers import layer_map
  from hls4ml.model.optimizer import get_available_passes, optimize_model
label_desc: Use image node_id 22 for calling the ModelGraph obj's underlying member method code with example usage: obj._compute_n_samples(x) and returns: int