class_docstr: A Function specifies a layer, its parameters, and its inputs (which
  are Tops from other layers).
class_docstr_tok: ["A","Function","specifies","a","layer",",","its","parameters",",","and","its","inputs","(","which","are","Tops","from","other","layers",")","."]
code: def _to_proto(self):
      bottom_names = []
      for inp in self.inputs:
          # inp._to_proto(layers, names, autonames)
          bottom_names.append(inp)
      layer = caffe_pb2.LayerParameter()
      layer.type = self.type_name
      layer.bottom.extend(bottom_names)
  
      if self.in_place:
          layer.top.extend(layer.bottom)
      else:
          for top in self.outputs:
              layer.top.append(top)
      layer.name = self.layer_name
      # print(self.type_name + "...")
      for k, v in six.iteritems(self.params):
          # special case to handle generic *params
          # print("generating "+k+"...")
  
          if k.endswith("param"):
              assign_proto(layer, k, v)
          else:
              try:
                  assign_proto(
                      getattr(
                          layer, _param_names[self.type_name] + "_param"
                      ),
                      k,
                      v,
                  )
              except (AttributeError, KeyError):
                  assign_proto(layer, k, v)
  
      return layer
  
file_path: insightface/tools/onnx2caffe/MyCaffe.py
imports: from collections import OrderedDict, Counter
  from caffe.proto import caffe_pb2
  from google import protobuf
  import six
label_desc: Use image node_id 4 for calling the Function obj's underlying member method code with example usage: obj._to_proto() and returns: layer