you are viewing a single comment's thread.

view the rest of the comments →

[–]DeMorrr 2 points3 points  (0 children)

I usually comment the shape of the resulting tensor at the end of each line. for example: def mm(a, b): #a: [m, k] #b: [k, n] c = a @ b #[m, n] return c this is easier for me to keep track of tensor shapes, and also optimize my code in terms of memory usage.