MCPcopy Create free account
hub / github.com/amazon-science/patchcore-inspection / __init__

Method __init__

src/patchcore/common.py:278–283  ·  view source on GitHub ↗
(self, hook_dict, layer_name: str, last_layer_to_extract: str)

Source from the content-addressed store, hash-verified

276
277class ForwardHook:
278 def __init__(self, hook_dict, layer_name: str, last_layer_to_extract: str):
279 self.hook_dict = hook_dict
280 self.layer_name = layer_name
281 self.raise_exception_to_break = copy.deepcopy(
282 layer_name == last_layer_to_extract
283 )
284
285 def __call__(self, module, input, output):
286 self.hook_dict[self.layer_name] = output

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected