Hi Patrick,
and thank for your answer!!
Yes, I meant each diagonal on my F [N,N] matrices for each batch.
But let’s look at the question another way. Let’s see I have a matrix M=[N,N] with zeros somewhere in there, that I want to use as a mask for all the F matrices. The purpose is to set to zero the element where in every matrix for the same indices where my matrix M has zeros. Is there an efficient way to do that in pytorch?  
I hope I explained it well, otherwise I will try to address the question better