class_docstr: Object-oriented handling of the residual path
  
  This supports scaling of the residual path, as proposed by DeepNet_
  .. _DeepNet: https://arxiv.org/pdf/2203.00555v1.pdf
  
  .. Note: the wrapped layers must accept all the inputs as a single list
class_docstr_tok: ["Object-oriented","handling","of","the","residual","path","This","supports","scaling","of","the","residual","path",",","as","proposed","by","DeepNet_","..","_DeepNet",":","https",":","\/\/arxiv.org\/pdf\/2203.00555v1.pdf","..","Note",":","the","wrapped","layers","must","accept","all","the","inputs","as","a","single","list"]
code: def __init__(self, layer: nn.Module, scale: Optional[float] = None):
      super().__init__()
      self.layer = layer
      self.scale = scale
  
      # PreNorm and PostNorm require all the tensors to be passed as a list
      self.wrap_inputs = isinstance(layer, RequiresWrappedInputs)
  
imports: from enum import Enum
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  from xformers import _is_triton_available
  from collections import namedtuple
label_desc: Use image node_id 1 to create a new Residual object from inherited base classes: nn, RequiresWrappedInputs with example: obj = Residual(layer, scale)