Can I use this method for replace out = out.reshape(out.size(0),-1) ?
class Flatten(nn.Module):
    def forward(self, input):
        return input.view(input.size(0), -1)

Then, forward function look like this:
def forward(self,x):
    out = self.layer1(x)
    out = self.layer2(out)
    out = self.layer3(out)
    out = self.layer4(out)
    out = Flatten(out)
    out = nn.ReLU(self.hidden(out))
    out = self.drop(out)
    out = self.dense1(out)
    out = self.dense2(out)
    out = nn.ReLU(self.fc1(out))
    out = self.fc(out)
    return out

Is this right ?