So let's say I have a list of (c x d)
matrices. Like say I have a
of them. And I have a
coefficients for each matrix.
Is there a quick way in NumPy to scalar-multiply each matrix by its coefficient at once while still keeping the tensor data structure, or do I need to manually go through in a for loop i.e. X = np.array([np.multiply(coefs[i], X[i]) for i in range(len(coefs))])
i.e. X.shape = (3, 4, 5)
, coefs.shape = (3)
.