class_docstr: A utility that implements methods to accelerate PyTorch training.
  
  Arguments:
      amp: If true, perform training with automatic mixed precision.
          Otherwise, use full precision.
class_docstr_tok: ["A","utility","that","implements","methods","to","accelerate","PyTorch","training",".","Arguments",":","amp",":","If","true",",","perform","training","with","automatic","mixed","precision",".","Otherwise",",","use","full","precision","."]
docstr: Computes the gradient of the specified tensor w.r.t. graph leaves.
  
  Args:
      tensor (torch.Tensor): Tensor of which the derivative will be computed.
docstr_tok: ["Computes","the","gradient","of","the","specified","tensor","w.r.t",".","graph","leaves",".","Args",":","tensor","(","torch.Tensor",")",":","Tensor","of","which","the","derivative","will","be","computed","."]
code: def backward(self, tensor: torch.Tensor) -> None:
      """Computes the gradient of the specified tensor w.r.t. graph leaves.
  
      Args:
          tensor (torch.Tensor): Tensor of which the derivative will be computed.
      """
      if self.amp_is_enabled:
          self.scaler.scale(tensor).backward()
      else:
          tensor.backward()
  
imports: import collections
  import logging
  import os
  import random
  import types
  from typing import Any, Callable, Dict, List, Optional, Union
  import numpy
  import torch
  from packaging.version import Version
  from torch.cuda.amp import GradScaler, autocast
  from torch.nn.parallel import DistributedDataParallel
  from torch.optim import Optimizer
  from torch.utils.data import DataLoader, DistributedSampler, IterableDataset, RandomSampler, SequentialSampler
  from ray._private.usage.usage_lib import TagKey, record_extra_usage_tag
  from ray.train._internal import session
  from ray.train._internal.accelerator import Accelerator
  from ray.train._internal.session import get_accelerator, set_accelerator
  from ray.util.annotations import Deprecated, PublicAPI
label_desc: Use image node_id 5 for calling the _TorchAccelerator obj's underlying member method code with example usage: obj.backward(tensor) without return types