How to stack/concatenate features set of different sizes?

I currently have multiple feature sets in the format (n,b), with n being the number of “elements” and b being the number of features. For example, I have (1024,128), (512, 256), and (256,512). How do I stack/concatenate my features with padding, so that get (x,y) where x is the largest and y is the largest of features, with the rest being “padded” of the empty features? For example, how would I get (1024, 128+256+512), from my example?