class_docstr: Implements the Numpy backend ops for a PC auto-batching VM.
class_docstr_tok: ["Implements","the","Numpy","backend","ops","for","a","PC","auto-batching","VM","."]
docstr: Asserts that the dtype of `val` matches `expected_dtype`.
  
  Args:
    expected_dtype: A numpy dtype
    val: An object convertible to `np.array`
    message: Optional diagnostic message.
  
  Raises:
    ValueError: If dtype does not match.
docstr_tok: ["Asserts","that","the","dtype","of","`","val","`","matches","`","expected_dtype","`",".","Args",":","expected_dtype",":","A","numpy","dtype","val",":","An","object","convertible","to","`","np.array","`","message",":","Optional","diagnostic","message",".","Raises",":","ValueError",":","If","dtype","does","not","match","."]
code: def assert_matching_dtype(self, expected_dtype, val, message=""):
      """Asserts that the dtype of `val` matches `expected_dtype`.
  
      Args:
        expected_dtype: A numpy dtype
        val: An object convertible to `np.array`
        message: Optional diagnostic message.
  
      Raises:
        ValueError: If dtype does not match.
      """
      if np.array(val).dtype != expected_dtype:
          raise ValueError(
              "Mismatched dtype: expected {} found {}. {}".format(
                  expected_dtype, val.dtype, message
              )
          )
  
imports: import collections
  import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 6 for calling the NumpyBackend obj's underlying member method code with example usage: obj.assert_matching_dtype(expected_dtype, val, message) without return types