code: def convert_precision_str_to_dtype(
      precision: str,
  ) -> Optional[torch.dtype]:
      """
      Converts precision as a string to a torch.dtype
  
      Args:
          precision: string containing the precision
  
      Raises:
          ValueError if an invalid precision string is passed.
  
      """
      if precision not in _DTYPE_STRING_TO_DTYPE_MAPPING:
          raise ValueError(
              f"Precision {precision} not supported. Please use one of {list(_DTYPE_STRING_TO_DTYPE_MAPPING.keys())}"
          )
      return _DTYPE_STRING_TO_DTYPE_MAPPING[precision]
  
imports: from typing import Mapping, Optional
  import torch
  from torch.cuda.amp.grad_scaler import GradScaler
  from torchtnt.utils.prepare_module import _is_fsdp_module
label_desc: Use image node_id 1 for calling a global function with example usage: convert_precision_str_to_dtype(precision) and returns: _DTYPE_STRING_TO_DTYPE_MAPPING