I have a follow up question.
If in a tensor T with size AxBxDxD i want to subtract the mean of each layer, do you know a fast way to do that too 8-?
Lets say for simplicity B is 1.
the classical way is to have two for loop for range(A) and range(B) and then subtract the mean from each layer, i was wondering if there is a fast way to do that too?
I cannot do T-torch.mean(T) because torch.mean(T) will give me the average of whole layers in T not each of them separately…
Edit: I figured it out
M = torch.mean(torch.mean(T,2),2)
a = (a.unsqueeze_(-1))
print a.size()
a = a.expand(A,D,D)
print a.size()
a.unsqueeze_(1)