code: def __init__(
      self,
      equivalent_module: nn.Module,
      config: Diffusers2DTransformerConfig,
  ):
      super(DeepSpeedDiffusersTransformerBlock, self).__init__()
      self.quantizer = module_inject.GroupQuantizer(
          q_int8=config.int8_quantization
      )
      # Ensure ops are built by the time we start running
      self.config = config
  
      self.ff1_w = self.quantizer.quantize(
          nn.Parameter(
              equivalent_module.ff.net[0].proj.weight.data,
              requires_grad=False,
          )
      )
      self.ff1_b = nn.Parameter(
          equivalent_module.ff.net[0].proj.bias.data,
          requires_grad=False,
      )
      self.ff2_w = self.quantizer.quantize(
          nn.Parameter(
              equivalent_module.ff.net[2].weight.data,
              requires_grad=False,
          )
      )
      self.ff2_b = nn.Parameter(
          equivalent_module.ff.net[2].bias.data, requires_grad=False
      )
  
      self.norm1_g = nn.Parameter(
          equivalent_module.norm1.weight.data, requires_grad=False
      )
      self.norm1_b = nn.Parameter(
          equivalent_module.norm1.bias.data, requires_grad=False
      )
      self.norm1_eps = equivalent_module.norm1.eps
  
      self.norm2_g = nn.Parameter(
          equivalent_module.norm2.weight.data, requires_grad=False
      )
      self.norm2_b = nn.Parameter(
          equivalent_module.norm2.bias.data, requires_grad=False
      )
      self.norm2_eps = equivalent_module.norm2.eps
  
      self.norm3_g = nn.Parameter(
          equivalent_module.norm3.weight.data, requires_grad=False
      )
      self.norm3_b = nn.Parameter(
          equivalent_module.norm3.bias.data, requires_grad=False
      )
      self.norm3_eps = equivalent_module.norm3.eps
  
      self.attn_1 = equivalent_module.attn1
      self.attn_2 = equivalent_module.attn2
  
      # Pull the bias in if we can
      if isinstance(self.attn_1, DeepSpeedDiffusersAttention):
          self.attn_1.do_out_bias = False
          self.attn_1_bias = self.attn_1.attn_ob
      else:
          self.attn_1_bias = nn.Paramaeter(
              torch.zeros_like(self.norm2_g), requires_grad=False
          )
  
      # Pull the bias in if we can
      if isinstance(self.attn_2, DeepSpeedDiffusersAttention):
          self.attn_2.do_out_bias = False
          self.attn_2_bias = self.attn_2.attn_ob
      else:
          self.attn_2_bias = nn.Paramaeter(
              torch.zeros_like(self.norm3_g), requires_grad=False
          )
  
      self.transformer_cuda_module = load_transformer_module()
      load_spatial_module()
  
file_path: H2O/h2o_flexgen/benchmark/third_party/DeepSpeed/deepspeed/ops/transformer/inference/diffusers_transformer_block.py
imports: import torch
  import torch.nn
  from ...None import op_builder
  from deepspeed import module_inject
  from .diffusers_attention import DeepSpeedDiffusersAttention
  from .bias_add import nhwc_bias_add
  from .diffusers_2d_transformer import Diffusers2DTransformerConfig
label_desc: Use image node_id 1 to create a new DeepSpeedDiffusersTransformerBlock object from inherited base classes: nn with example: obj = DeepSpeedDiffusersTransformerBlock(equivalent_module, config)