In NumPy, it's possible to specify an argument to np.dot and np.multiply called out, so that they won't create a new array when returning the result. However, in my use case, I need to compute the following:
c = c + np.dot(a, b) # where a and b are matrices of shape n x m, and m x pc = c + np.multiply(a, b) # where a and b are matrices of equal shape n x m
Is there a way to do this without creating a new array each time? For example, something like this:
np.dot(a, b, add_to=c)np.multiply(a, b, add_to=c)