If you have different “linear layers,” (one layer for each input) then this sounds like it would be a batched-matrix multiply:
torch.bmm — PyTorch 1.10.0 documentation
b = 8000,
n = 1,
m = 128,
p = output dim of linear layer.
It should also be expressible as an einsum:
torch.einsum — PyTorch 1.10.0 documentation 1