I know that tensors have an apply
method, but this only applies a function to each element. Is there an elegant way to do row-wise operations? For example, can I multiply each row by a different value?
Say
A =
1 2 3
4 5 6
7 8 9
and
B =
1
2
3
and I want to multiply each element in the i
th row of A by the i
th element of B to get
1 2 3
8 10 12
21 24 27
how would I do that?