class_docstr: 将多个特征矩阵的值进行融合(add操作)
class_docstr_tok: ["\u5c06\u591a\u4e2a\u7279\u5f81\u77e9\u9635\u7684\u503c\u8fdb\u884c\u878d\u5408","(","add\u64cd\u4f5c",")"]
code: def __init__(self, layers, weight=False):
      super(WeightedFeatureFusion, self).__init__()
      self.layers = layers  # layer indices
      self.weight = weight  # apply weights boolean
      self.n = len(layers) + 1  # number of layers 融合的特征矩阵个数
      if weight:
          self.w = nn.Parameter(torch.zeros(self.n), requires_grad=True)
  
imports: import torch.nn.functional
  from .utils import *
label_desc: Use image node_id 1 to create a new WeightedFeatureFusion object from inherited base classes: nn with example: obj = WeightedFeatureFusion(layers, weight)