I still think you might(!) need to swap the dimensions first since you c dimensions is the first in the input and the last in the output. Sure, you can reshape it immediately, but you might mess up your data semantically (see here)
I would have no doubt that your solution is perfectly fine, I honestly can’t tell from just look at the line. I’m just wondering if something like this
X = X.permute(1, 2, 0)
X = X.reshape(-1, 3) # not 100% sure if correct
might not be much easier to read/maintain.