The proposed for loop would execute each time step (slicing the input in dim1) in the CNN, which would be a workaround assuming you would run out of memory otherwise. Since your flattening operation works fine, I would prefer your approach and there won’t be a difference except my for loop approach being slower.