Hi,
This seems to work no? You keep the first dimension and collapse all the others. But your Tensor had only 2 dimensions to begin with.
By the way for use within a Sequential, you can define a custom __init__() function on your View Module that will take the shape as input.