class_docstr: Model helper for building models on top of layers abstractions.
  
  Each layer is the abstraction that is higher level than Operator. Layer
  is responsible for ownership of it's own parameters and can easily be
  instantiated in multiple nets possible with different sets of ops.
  As an example: one can easily instantiate predict and train nets from
  the same set of layers, where predict net will have subset of the
  operators from train net.
class_docstr_tok: ["Model","helper","for","building","models","on","top","of","layers","abstractions",".","Each","layer","is","the","abstraction","that","is","higher","level","than","Operator",".","Layer","is","responsible","for","ownership","of","it","'s","own","parameters","and","can","easily","be","instantiated","in","multiple","nets","possible","with","different","sets","of","ops",".","As","an","example",":","one","can","easily","instantiate","predict","and","train","nets","from","the","same","set","of","layers",",","where","predict","net","will","have","subset","of","the","operators","from","train","net","."]
code: def __getattr__(self, layer):
      def is_functional_layer(layer):
          if core.IsOperator(layer):
              return True
          elif layer.startswith("FunctionalLayer"):
              return True
          else:
              return False
  
      def resolve_functional_layer(layer):
          if core.IsOperator(layer):
              return layer
          elif layer.startswith("FunctionalLayer"):
              return layer[len("FunctionalLayer") :]
          else:
              raise ValueError(
                  "%s cannot be resolved as functional layer" % layer
              )
  
      if layer.startswith("__"):
          raise AttributeError(layer)
  
      # TODO(amalevich): Add add support for ifbpy inline documentation
      if layers.layer_exists(layer):
  
          def wrapper(*args, **kwargs):
              new_layer = layers.create_layer(
                  layer, self, *args, **kwargs
              )
              if kwargs.get("output_to_metrics", False):
                  new_layer.export_output_for_metrics()
              if kwargs.get("params_to_metrics", False):
                  new_layer.export_params_for_metrics()
              return self.add_layer(new_layer)
  
          return wrapper
      elif is_functional_layer(layer):
          # TODO(xlwang): Desginated layer shadows the usage of an op as a
          # single layer. To enforce using an op (e.g. Split) as functional
          # layer, one can call 'model.FunctionalLayerSplit'
          layer = resolve_functional_layer(layer)
  
          def wrapper(*args, **kwargs):
              def apply_operator(net, in_record, out_record, **kwargs):
                  # TODO(amalevich): Switch to net.operator as soon as it gets
                  # landed
                  net.__getattr__(layer)(
                      in_record.field_blobs(),
                      out_record.field_blobs(),
                      **kwargs,
                  )
  
              if "name" not in kwargs:
                  kwargs["name"] = layer
  
              new_layer = layers.create_layer(
                  "Functional",
                  self,
                  *args,
                  function=apply_operator,
                  **kwargs,
              )
  
              if kwargs.get("output_to_metrics", False):
                  new_layer.export_output_for_metrics()
              if kwargs.get("params_to_metrics", False):
                  new_layer.export_params_for_metrics()
  
              return self.add_layer(new_layer)
  
          return wrapper
      else:
          # this needs to be an AttributeError to fit hasattr semantics
          raise AttributeError(
              "Trying to create non-registered layer: {}".format(layer)
          )
  
imports: from caffe2.python import core, model_helper, schema, scope, utils, muji
  from caffe2.python.modeling.parameter_info import ParameterInfo
  from caffe2.python.modeling.parameter_sharing import parameter_sharing_context
  from caffe2.python.modeling.net_modifier import NetModifier
  from caffe2.python.optimizer import get_param_device, Optimizer
  from caffe2.python.regularizer import Regularizer, RegularizationBy
  from caffe2.python.layers import layers
  import logging
  import numpy
  import copy
label_desc: Use image node_id 44 for calling the LayerModelHelper obj's underlying member method code with example usage: obj.__getattr__(layer) and returns: wrapper, True, layer, self, wrapper, True, False, layer, self