Returns whether a module in `model` has been flagged as a 'leaf' module. See `set_z3_leaf_modules` for more details. Args: model (torch.nn.Module): The model to which the leaf module flag will be applied. Returns: bool: Whether the module has been flag
(model: torch.nn.Module)
| 13 | |
| 14 | |
| 15 | def z3_leaf_module(model: torch.nn.Module) -> bool: |
| 16 | """Returns whether a module in `model` has been flagged as a 'leaf' module. |
| 17 | See `set_z3_leaf_modules` for more details. |
| 18 | Args: |
| 19 | model (torch.nn.Module): The model to which the leaf module flag will be applied. |
| 20 | Returns: |
| 21 | bool: Whether the module has been flagged as a 'leaf' module. |
| 22 | """ |
| 23 | return hasattr(model, '_z3_leaf') and model._z3_leaf |
| 24 | |
| 25 | |
| 26 | def z3_leaf_parameter(model: torch.nn.Parameter) -> bool: |
no outgoing calls