MCPcopy Create free account
hub / github.com/apple/axlearn / convert_to_enum

Function convert_to_enum

axlearn/common/utils.py:311–314  ·  view source on GitHub ↗
(p: Union[RematType, bool])

Source from the content-addressed store, hash-verified

309 combine_fn = maybe_instantiate(combine_fn)
310
311 def convert_to_enum(p: Union[RematType, bool]) -> RematType:
312 if isinstance(p, bool):
313 p = Saveable if p else Recompute
314 return p
315
316 def policy(prim, *args, **kwargs):
317 p1 = convert_to_enum(policy_1(prim, *args, **kwargs))

Callers 1

policyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected