def forward(self, x):
        x = self.model(x)
        with torch.no_grad():
            x = x.view(-1,150,1024,size,size)
        x = self.c1(x)
        with torch.no_grad():
            x = x[0][0][:,-1,:,:,:]
        x = x.view(-1,512*size*size)
        x = self.dp(self.relu(self.fc1(x)))
        x = self.dp(self.relu(self.fc2(x)))
        x = self.dp(self.fc3(x))
        return x

Is this the correct way to reshape the array inside forward function or is there any better way.
Thanks in advance.