Skip to content
Snippets Groups Projects
Commit c449271d authored by Bhatu's avatar Bhatu
Browse files

Add support for broadcasting semantics for binops.

We add broadcasting support for add, sub, mul and equal.

The broadcasting semantics are specified here
https://numpy.org/doc/stable/user/basics.broadcasting.html

Say we are given input
A (4d array):  8 x 1 x 6 x 1
B (3d array):      7 x 1 x 5

We generate a loop with
Result (4d array):  8 x 7 x 6 x 5
for i0=[0:8]
  for i1=[0:7]
    for i2=[0:6]
      for i3=[0:8]
        Result[i0][i1][i2][i3] = A[i0][0][i2][0] {+,*,-,==} B[i1][0][i3]
parent cee44f6d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment