code: def custom_layer_factory(self):
      import os
  
      pk_paths = []
      default = os.path.dirname(os.path.abspath(__file__))
      location = os.environ.get("CAFFE2FLUID_CUSTOM_LAYERS", default)
      pk_name = "custom_layers"
      pk_dir = os.path.join(location, pk_name)
      pk_paths.append((location, pk_dir))
  
      location = LeNet.custom_layers_path
      pk_dir = os.path.join(LeNet.custom_layers_path, pk_name)
      pk_paths.append((location, pk_dir))
  
      for loc, pk_dir in pk_paths:
          if os.path.exists(pk_dir):
              if loc not in sys.path:
                  sys.path.insert(0, loc)
                  break
  
      try:
          from custom_layers import make_custom_layer
  
          return make_custom_layer
      except Exception as e:
          print("maybe you should set $CAFFE2FLUID_CUSTOM_LAYERS first")
          raise e
  
imports: from __future__ import print_function
  from builtins import str
  from past.builtins import basestring
  from builtins import object
  import sys
  import os
  import math
  import numpy
label_desc: Use image node_id 1 for calling the LeNet obj's underlying member method code with example usage: obj.custom_layer_factory() and returns: make_custom_layer