Solved by lly-zero-one in post #2 
              
              
                You can actually try to comment out the two lines as https://github.com/pytorch/pytorch/pull/30442, since the tensor iterator supports broadcast.