docstr: Adds layer initialization operators to passed net.
docstr_tok: ["Adds","layer","initialization","operators","to","passed","net","."]
code: def add_init_params(self, init_net):
      """
      Adds layer initialization operators to passed net.
      """
      for param in self.params:
          # TODO(amalevich): Either return back to lambdas, that add
          # all params (looks a bit safer and breaking less
          # abstractions) or extend Net interface to this type of
          # operations better
          # TODO(xlwang) init_net._net.op has type google.protobuf.\
          # internal.containers.RepeatedCompositeFieldContainer, but
          # the version of protobuf in fbcode does not support append
          # so extend is used
          init_op = param.initializer
          current_device_scope = scope.CurrentDeviceScope()
          if not init_op:
              continue
  
          if (
              not init_op.HasField("device_option")
              and current_device_scope
          ):
              init_op = caffe2_pb2.OperatorDef()
              init_op.CopyFrom(param.initializer)
              init_op.device_option.CopyFrom(current_device_scope)
  
          # do not add duplicated init ops
          if any(
              utils.OpAlmostEqual(op, init_op, "debug_info")
              for op in init_net._net.op
          ):
              continue
  
          init_net._net.op.extend([init_op])
  
imports: import logging
  from collections import namedtuple
  import numpy
  from caffe2.proto import caffe2_pb2
  from caffe2.python import core, schema, scope, utils, workspace
  from caffe2.python.layers.tags import TagContext
label_desc: Use image node_id 14 for calling the ModelLayer obj's underlying member method code with example usage: obj.add_init_params(init_net) without return types