@deepbrain your proposal looks pretty clean and nice, but it’s limited to settings where structure is not dynamic, and to settings where input size is fixed (otherwise Linear layers’ dimensions are not fixed). I like the proposal quite a bit, let me discuss this with the other devs.