MCPcopy Create free account
hub / github.com/deepseek-ai/DeepSpec / _get_hook_tensor

Function _get_hook_tensor

scripts/data/prepare_target_cache.py:73–80  ·  view source on GitHub ↗
(output)

Source from the content-addressed store, hash-verified

71
72
73def _get_hook_tensor(output):
74 if isinstance(output, torch.Tensor):
75 return output
76 if isinstance(output, (tuple, list)) and output:
77 first = output[0]
78 if isinstance(first, torch.Tensor):
79 return first
80 raise TypeError(f"Unsupported target hook output type: {type(output)!r}")
81
82
83def run_target_forward_with_hooks(

Callers 1

hookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected