MCPcopy
hub / github.com/google-deepmind/penzai / freeze_params

Function freeze_params

penzai/core/variables.py:854–861  ·  view source on GitHub ↗

r"""Version of `freeze_variables` that only freezes `Parameter`\ s.

(
    tree: Any,
    predicate: Callable[[Parameter], bool] | None = None,
)

Source from the content-addressed store, hash-verified

852
853
854def freeze_params(
855 tree: Any,
856 predicate: Callable[[Parameter], bool] | None = None,
857) -> Any:
858 r"""Version of `freeze_variables` that only freezes `Parameter`\ s."""
859 return freeze_variables( # type: ignore
860 tree, predicate=_type_filtered_predicate(predicate, Parameter)
861 )
862
863
864@typing.overload

Callers

nothing calls this directly

Calls 2

freeze_variablesFunction · 0.85
_type_filtered_predicateFunction · 0.85

Tested by

no test coverage detected