MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / _try_forward

Function _try_forward

profile.py:362–376  ·  view source on GitHub ↗

Attempt a forward pass. Returns True on success.

(
    model: nn.Module,
    inputs: Dict[str, Any],
)

Source from the content-addressed store, hash-verified

360
361
362def _try_forward(
363 model: nn.Module,
364 inputs: Dict[str, Any],
365) -> bool:
366 """Attempt a forward pass. Returns True on success."""
367 try:
368 if "input_ids" in inputs:
369 model(input_ids=inputs["input_ids"])
370 elif "x" in inputs:
371 model(inputs["x"])
372 else:
373 model(**inputs)
374 return True
375 except Exception:
376 return False
377
378
379def _prepare_model_and_input(

Callers 1

_prepare_model_and_inputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected