MCPcopy Create free account
hub / github.com/pytorch/pytorch / wrapper

Method wrapper

caffe2/python/layer_model_helper.py:580–586  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

578 # TODO(amalevich): Add add support for ifbpy inline documentation
579 if layers.layer_exists(layer):
580 def wrapper(*args, **kwargs):
581 new_layer = layers.create_layer(layer, self, *args, **kwargs)
582 if kwargs.get("output_to_metrics", False):
583 new_layer.export_output_for_metrics()
584 if kwargs.get("params_to_metrics", False):
585 new_layer.export_params_for_metrics()
586 return self.add_layer(new_layer)
587 return wrapper
588 elif is_functional_layer(layer):
589 # TODO(xlwang): Desginated layer shadows the usage of an op as a

Callers

nothing calls this directly

Calls 4

add_layerMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected