code: def default_dtype(dtype):
      """
      Context manager to temporarily set PyTorch default dtype.
  
      :param str host: Either "cuda" or "cpu".
      """
      old = torch.get_default_dtype()
      try:
          torch.set_default_dtype(dtype)
          yield
      finally:
          torch.set_default_dtype(old)
  
imports: import contextlib
  import numbers
  import os
  import re
  import warnings
  from itertools import product
  import numpy
  import pytest
  import torch
  import torch.cuda
  from numpy.testing import assert_allclose
  from pytest import approx
label_desc: Use image node_id 7 for calling a global function with example usage: default_dtype(dtype) without return types