Thanks. yes, I got a size mismatch error if I try second approach. In case of first one, it gives an error  size '[3 x 446520]' is invalid for input with 446520 elements at /pytorch/torch/lib/TH/THStorage.c:41. What should I do next?