class_docstr: Equivalent to torch.cuda.amp.autocast, but checks device compute capability
  to activate the feature only when the GPU has tensor cores to leverage AMP.
  
  **Attributes:**
  
  * `active` (bool): Whether AMP is currently active. This attribute is at the class
  level
  
  **Usage:**
  
  ```python
  >>> import lightwood.helpers.torch as lt
  >>> with lt.LightwoodAutocast():
  ...     # This code will be executed in AMP mode.
  ...     pass
docstr: Initializes the context manager for Automatic Mixed Precision (AMP) functionality.
  
  Args:
      enabled (bool, optional): Whether to enable AMP. Defaults to True.
docstr_tok: ["Initializes","the","context","manager","for","Automatic","Mixed","Precision","(","AMP",")","functionality",".","Args",":","enabled","(","bool",",","optional",")",":","Whether","to","enable","AMP",".","Defaults","to","True","."]
code: def __init__(self, enabled=True):
      """
      Initializes the context manager for Automatic Mixed Precision (AMP) functionality.
  
      Args:
          enabled (bool, optional): Whether to enable AMP. Defaults to True.
      """
      self.major = 0  # GPU major version
      torch_version = [
          int(i) for i in torch.__version__.split(".")[:-1]
      ]
  
      if (
          not enabled
          or not torch.cuda.is_available()
          or torch_version[0] < 1
          or torch_version[1] < 6
      ):
          self._enabled = False
      else:
          device, _ = get_devices()
          if device.type == "cuda":
              # tensor cores only exist from 7 onwards
              # if this is not the case, then AMP is unnecessary overhead
              self.major, _ = torch.cuda.get_device_capability(device)
              self._enabled = enabled if self.major > 6 else False
          else:
              self._enabled = (
                  False  # gpu is available but cpu is forced
              )
  
      self.prev = self._enabled  # necessary reference to exit
      LightwoodAutocast.active = self._enabled
  
file_path: lightwood/lightwood/helpers/torch.py
imports: import functools
  import torch
  from torch.nn.functional import pad
  from lightwood.helpers.device import get_devices
label_desc: Use image node_id 1 to create a new LightwoodAutocast object  with example: obj = LightwoodAutocast(enabled)