example, if you want to force a subregion to run in a particular
   "dtype".  Disabling autocast gives you explicit control over the
   execution type.  In the subregion, inputs from the surrounding
   region should be cast to "dtype" before use:
  # Creates some tensors in default dtype (here assumed to be float32)
  a_float32 = torch.rand((8, 8), device="cuda")
  b_float32 = torch.rand((8, 8), device="cuda")
  c_float32 = torch.rand((8, 8), device="cuda")
  d_float32 = torch.rand((8, 8), device="cuda")

  with autocast():
      e_float16 = torch.mm(a_float32, b_float32)
      with autocast(enabled=False):
          # Calls e_float16.float() to ensure float32 execution
          # (necessary because e_float16 was created in an autocasted region)
          f_float32 = torch.mm(c_float32, e_float16.float())

      # No manual casts are required when re-entering the autocast-enabled region.
