Say the original data is A=[tensor([1., 2., 3.]), tensor([2.]), tensor([1., 2., 3., 4.])]. For convenience of some other operations, I concat the data into A_cat = tensor([1., 2., 3., 2., 1., 2., 3., 4.]).
Now my question is, how can I multiply A_cat with another tensor like B=tensor([5., 3., 2.]), so that each element of B multiply the each tensor in A. (B has the same length as A). Is there any efficient way with native pytorch or nestedtensor lib?
Thanks.