code: def _add_ops_impl(self, net, enable_diagnose):
      x = self.concat_data(net)
      weight = net.NextScopedBlob("weight")
      reg = net.NextScopedBlob("reg")
      weighted_x = net.NextScopedBlob("weighted_x")
      weighted_x_add_reg = net.NextScopedBlob("weighted_x_add_reg")
      self.weight_func(x, net, weight)
      self.reg_func(net, reg)
      net.Mul([weight, x], weighted_x)
      net.Add([weighted_x, reg], weighted_x_add_reg)
      net.SumElements(weighted_x_add_reg, self.output_schema())
      if enable_diagnose:
          for i in range(self.num):
              net.Slice(
                  weight, self.weight_i[i], starts=[i], ends=[i + 1]
              )
  
file_path: pytorch/caffe2/python/layers/adaptive_weight.py
imports: import numpy
  from caffe2.python import core, schema
  from caffe2.python.layers.layers import ModelLayer
  from caffe2.python.regularizer import BoundedGradientProjection, LogBarrier
label_desc: Use image node_id 9 for calling the AdaptiveWeight obj's underlying member method code with example usage: obj._add_ops_impl(net, enable_diagnose) without return types