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

Function policy

axlearn/common/utils.py:186–194  ·  view source on GitHub ↗
(prim, *_, **params)

Source from the content-addressed store, hash-verified

184 """
185
186 def policy(prim, *_, **params):
187 if str(prim) == str(name_p):
188 if names_which_can_be_saved and re.fullmatch(names_which_can_be_saved, params["name"]):
189 return Saveable
190 if names_which_can_be_offloaded and re.fullmatch(
191 names_which_can_be_offloaded, params["name"]
192 ):
193 return Offloadable(src=offload_src, dst=offload_dst)
194 return Recompute # not saveable unless it's in the allow-list
195
196 return policy
197

Calls 2

convert_to_enumFunction · 0.85
combine_fnFunction · 0.85