docstr: Sets the dtype for value matrices.
  
  Parameters
  ----------
  dtype: Instance of numpy.dtype of torch.dtype. (default: None)
      Sets the dtype to `dtype`. If None set to either numpy.float64 or torch.float64 depending on the backend.
docstr_tok: ["Sets","the","dtype","for","value","matrices",".","Parameters","--","--","--","--","--","dtype",":","Instance","of","numpy.dtype","of","torch.dtype",".","(","default",":","None",")","Sets","the","dtype","to","`","dtype","`",".","If","None","set","to","either","numpy.float64","or","torch.float64","depending","on","the","backend","."]
code: def set_dtype(self, dtype=None):
      """
      Sets the dtype for value matrices.
  
      Parameters
      ----------
      dtype: Instance of numpy.dtype of torch.dtype. (default: None)
          Sets the dtype to `dtype`. If None set to either numpy.float64 or torch.float64 depending on the backend.
      """
      if self.BACKEND == "numpy":
          if dtype is None:
              self.DTYPE = "float64"
          elif not isinstance(dtype, np.dtype):
              raise ValueError(
                  f"Backend is set to numpy, dtype must be an instance of np.dtype. Got: {type(dtype)}"
              )
          else:
              self.DTYPE = dtype
  
      elif self.BACKEND == "torch":
          if dtype is None:
              self.DTYPE = torch.float64
          elif not isinstance(dtype, torch.dtype):
              raise ValueError(
                  f"Backend is set to torch, dtype must be an instance of torch.dtype. Got: {type(dtype)}"
              )
          else:
              self.DTYPE = dtype
  
file_path: pgmpy/pgmpy/global_vars.py
imports: import logging
  import numpy
  import torch
label_desc: Use image node_id 8 for calling the Config obj's underlying member method code with example usage: obj.set_dtype(dtype) without return types