Good idea! It works on my model when runing on a single gpu. But when I use DataParallel to run on multiple gpus, an error occured: RuntimeError: Can't detach views in-place. Use detach() instead. Do you have any advice to solve it? Thanks~