Connecting the models

Hello

I want to connect 2 models and run training.

My first model A generates one-dimensional output.
While batches are being processed, in the training loop, I want to collect 1024 of these and give them to Model B as input.

What is the best way to connect Model A and Model B and backpropagate in a suitable fashion?