(prim, *_, **params)
| 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 |