I want to build an unflatten layer. How would one do that?
e.g. of the flatten layer:
#mini class to add a flatten layer to the ordered dictionary
class Flatten(nn.Module):
    def forward(self, input):
        return input.view(input.size(0),-1)

from your code I assume the only way is to do this:
#mini class to add an unflatten layer to the ordered dictionary
class UnFlatten(nn.Module):
    def forward(self, flat_ouput, original_size):
        return flat_ouput.view(original_size)