Let me assume two new tensors a_new, c_new have shape: (5, 70) after padding. So it is as simple as having a combine_tensor = torch.cat([a_new, b, c_new], 0). With that combine_tensor has shape of (15, 70) and Function f takes combine_tensor as input.