class_docstr: Wrapper for running CoreML models using coremltools
      
class_docstr_tok: ["Wrapper","for","running","CoreML","models","using","coremltools"]
code: def _verify_inputs(self, **kwargs):
      for k, v in kwargs.items():
          if k in self.expected_inputs:
              if not isinstance(v, np.ndarray):
                  raise TypeError(
                      f"Expected numpy.ndarray, got {v} for input: {k}"
                  )
  
              expected_dtype = self.expected_inputs[k]["dtype"]
              if not v.dtype == expected_dtype:
                  raise TypeError(
                      f"Expected dtype {expected_dtype}, got {v.dtype} for input: {k}"
                  )
  
              expected_shape = self.expected_inputs[k]["shape"]
              if not v.shape == expected_shape:
                  raise TypeError(
                      f"Expected shape {expected_shape}, got {v.shape} for input: {k}"
                  )
          else:
              raise ValueError(f"Received unexpected input kwarg: {k}")
  
file_path: ml-stable-diffusion/python_coreml_stable_diffusion/coreml_model.py
imports: import coremltools
  import logging
  import json
  import numpy
  import os
  import time
label_desc: Use image node_id 2 for calling the CoreMLModel obj's underlying member method code with example usage: obj._verify_inputs() without return types