Thank you for your reply. I have tried implementing this, but the problem arises as my dataset does not acquire batch dimension until it passes through data loader. Is there any way to flatten after the data loader and before passing data to my network? Thanks!