使用 apex 进行混合精度训练时报错:
if cached_x.grad_fn.next_functions[1][0].variable is not x:
IndexError: tuple index out of range
解决方案:
修改报错的位置的源码:
将if cached_x.grad_fn.next_functions[1][0].variable is not x:
修改为:
next_functions_available=False
if next_functions_available and cached_x.grad_fn.next_functions[1][0].variable is not x: