def METHOD_NAME(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])