使用PyTorch炼丹的过程中,我们最怕的就是在DataLoader里debug,原因无他:多进程驱动的DataLoader很难给出清晰的traceback报错,即便将num_worker设为0不启用多进程,有时一个DataLoader Worker PID XXX is killed by signal: Killed或者Segmentation Fault还是能让用户一脸懵逼。新手炼丹师...
本文大多从Python代码阐释协程,如果你还不知道什么是协程,建议先阅读https://www.zhihu.com/question/294188439/answer/555273313;本文也算作观看Fear and Awaiting in Async: A Savage Journey to the Heart of the Coroutine Dream的笔记。从经典的网络socket...