(obj, attr_path)
| 325 | |
| 326 | |
| 327 | def get_nested_attribute(obj, attr_path): |
| 328 | if isinstance(obj, torch.nn.parallel.DistributedDataParallel): |
| 329 | obj = obj.module |
| 330 | attributes = attr_path.split('.') |
| 331 | for attr in attributes: |
| 332 | obj = getattr(obj, attr) |
| 333 | return obj |
| 334 | |
| 335 | |
| 336 | def lrs_to_str(lrs: List): |
no outgoing calls
no test coverage detected