class_docstr: Simple and lightweight Detail Capture Module for ViT Matting.
code: def __init__(self, config):
      super().__init__()
      if (
          len(config.fusion_hidden_sizes)
          != len(config.convstream_hidden_sizes) + 1
      ):
          raise ValueError(
              "The length of fusion_hidden_sizes should be equal to the length of convstream_hidden_sizes + 1."
          )
  
      self.config = config
      self.convstream = VitMatteConvStream(config)
      self.conv_chans = self.convstream.conv_chans
  
      self.fusion_blocks = nn.ModuleList()
      self.fusion_channels = [
          config.hidden_size
      ] + config.fusion_hidden_sizes
  
      for i in range(len(self.fusion_channels) - 1):
          self.fusion_blocks.append(
              VitMatteFusionBlock(
                  config=config,
                  in_channels=self.fusion_channels[i]
                  + self.conv_chans[-(i + 1)],
                  out_channels=self.fusion_channels[i + 1],
              )
          )
  
      self.matting_head = VitMatteHead(config)
  
imports: from dataclasses import dataclass
  from typing import Optional, Tuple
  import torch
  from torch import nn
  from ...None import AutoBackbone
  from ...modeling_utils import PreTrainedModel
  from ...utils import ModelOutput, add_start_docstrings, add_start_docstrings_to_model_forward, replace_return_docstrings
  from .configuration_vitmatte import VitMatteConfig
label_desc: Use image node_id 1 to create a new VitMatteDetailCaptureModule object from inherited base classes: nn with example: obj = VitMatteDetailCaptureModule(config)