hoangcuong2011:

I sped up by adding padding for tensor_a and tensor_c to make them to the same shape of tensor_b, i.e.(5, 70) first, then combining these three together into a single one and calling f(combing_tensor) instead.


How had you done this here? You wrote that you had padded your a into the shape torch.Size([5, 70]), how did you afterwards combine a and b? Did you do it with torch.cat() or torch.stack()?