(p: Union[RematType, bool])
| 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)) |