Im trying to port a python numpy implementation of something into Julia and one step is
import numpy as np
np.random.rand(12,10) + np.random.rand(10)
Output shape - (12, 10)
but in Julia
rand(12,10) + rand(10)
throws DimensionMismatch(“dimensions must match: a has dims (Base.OneTo(12), Base.OneTo(10)), b has dims (Base.OneTo(10),), mismatch at 1”)
I tried broadcasting
rand(12,10) .+ rand(10)
DimensionMismatch(“arrays could not be broadcast to a common size; got a dimension with lengths 12 and 10”)
Im so confused. Is there something different here?