Because you are not only storing x but all the information required to compute backpropagation. Besides, the information required for a siamese architecture is even more.
You are saving all the information corresponding to self.mynet, if that network is big you will require lot of space