Fix MNIST to work again.

This commit is contained in:
Austin Garrett
2018-04-09 17:00:45 -04:00
parent 20af804ba0
commit 1ad35a3c4a
+7 -1
View File
@@ -10,7 +10,13 @@ def EndChannels(f, make_contiguous = False):
def __init__(self):
super(WrappedLayer, self).__init__()
self.forward = lambda x: f(x.permute(0,3,1,2)).permute(0,2,3,1)
self.f = f
def forward(self, x):
x = x.permute(0,3,1,2)
x = self.f(x)
x = x.permute(0,2,3,1)
return x
return WrappedLayer()