Pavel Gorgulov
10/11/2021, 6:46 PMaltavir
10/11/2021, 7:35 PMa = numpy.array([[1, 2, 3],[1, 2, 3]])
b = numpy.array([1, 2, 3])
a + b
will work in numpy and won't work in multik. I am not a fan of implicit broadcasting (and do not like numpy ideology in general), but one needs to be clear about that. In KMath I insisted that broadcasting is not possible in default algebras.Pavel Gorgulov
10/12/2021, 12:19 PMa = numpy.array([[1, 2, 3],[1, 2, 3]])
b = numpy.array([1, 2, 3])
a + b
This code will not work for us even at the compilation stage, since the dimensions are different. We introduced Dimension
right from the start for this kind of checks.altavir
10/12/2021, 12:59 PMaltavir
10/12/2021, 1:02 PM.
, but it solves the problem only for simple one-argument operations. When we started to think about how to apply specific broadcasting rules to specific cases, we came to the algebra-based model, we use now in KMath. We use different rules for different scopes.Pavel Gorgulov
10/12/2021, 4:19 PMaltavir
10/12/2021, 4:20 PMaltavir
10/12/2021, 4:27 PMaltavir
10/12/2021, 4:40 PMPavel Gorgulov
10/12/2021, 5:04 PMaltavir
10/12/2021, 5:05 PMPavel Gorgulov
10/12/2021, 6:01 PM