Solved by ptrblck in post #2 
              
              
                Your idea sounds like a fun project!  
Try to avoid the inplace operations and create a new tensor via: 
f2 = f1.mean(1, keepdim=True)

and pass f2 to the discriminator.