(*args, id=None, **kwargs)
| 42 | _PRINTED_IDS = set() |
| 43 | |
| 44 | def printonce(*args, id=None, **kwargs): |
| 45 | if id is None: |
| 46 | id = ' '.join(map(str, args)) |
| 47 | |
| 48 | if id not in _PRINTED_IDS: |
| 49 | print(*args, **kwargs) |
| 50 | _PRINTED_IDS.add(id) |
| 51 | |
| 52 | def print0once(*args, **kwargs): |
| 53 | if rank0(): |