I have a unique implementation where I have to process videos with dynamic frame rates (that is the number of frames is different for each video in a batch). I am stacking all the frames in a single tensor and processing the same from there on. This works fine with Conv2D layer but creating a 2D tensor (batch_size, features) by a flattening operation this has to be fed to a Dense layer. I can't find a suitable way to implement this.
For more information on why it should be like this kindly explore: explore this link. Instead of the MNIST images, I have multiple videos in a single bag, each with a variable number of frames.