code: def data_type_to_dtype(data_type: DataType) -> torch.dtype:
      if data_type.value == DataType.FP32.value:
          return torch.float32
      elif data_type.value == DataType.FP16.value:
          return torch.float16
      elif data_type.value == DataType.BF16.value:
          return torch.bfloat16
      elif data_type.value == DataType.INT64.value:
          return torch.int64
      elif data_type.value == DataType.INT32.value:
          return torch.int32
      elif data_type.value == DataType.INT8.value:
          return torch.int8
      elif data_type.value == DataType.UINT8.value:
          return torch.uint8
      elif data_type.value == DataType.INT4.value:
          return torch.quint4x2
      elif data_type.value == DataType.INT2.value:
          return torch.quint2x4
      else:
          raise ValueError(
              f"DataType {data_type} cannot be converted to dtype"
          )
  
imports: from dataclasses import dataclass, field
  from enum import Enum, unique
  from functools import partial
  from math import sqrt
  from typing import Callable, Dict, List, NamedTuple, Optional
  import torch
  from fbgemm_gpu.split_embedding_configs import SparseType
  from fbgemm_gpu.split_table_batched_embeddings_ops_training import PoolingMode
  from torchrec.types import DataType
label_desc: Use image node_id 5 for calling a global function with example usage: data_type_to_dtype(data_type) and returns: torch, torch, torch, torch, torch, torch, torch, torch, torch