This function disables printing when not in master process
(is_master)
| 170 | |
| 171 | |
| 172 | def setup_for_distributed(is_master): |
| 173 | """ |
| 174 | This function disables printing when not in master process |
| 175 | """ |
| 176 | import builtins as __builtin__ |
| 177 | builtin_print = __builtin__.print |
| 178 | |
| 179 | def print(*args, **kwargs): |
| 180 | force = kwargs.pop('force', False) |
| 181 | if is_master or force: |
| 182 | builtin_print(*args, **kwargs) |
| 183 | |
| 184 | __builtin__.print = print |
| 185 | |
| 186 | |
| 187 | def is_dist_avail_and_initialized(): |
no outgoing calls
no test coverage detected
searching dependent graphs…