3 ms·
I recommend X + Y[:, tf.newaxis] For higher dimensions of Y, you can use (but it might be ill-advised) X + Y[:, tf.newaxis, ...]
by im3w1l 6y ago
I recommend
X + Y[:, tf.newaxis]
For higher dimensions of Y, you can use (but it might be ill-advised)
X + Y[:, tf.newaxis, ...]
- mcabbott 6y agoSure! The desire for fancier notation is from more complicated examples, the kind where you write elaborate comments to explain why you're permuting 3rd & 4th dim of B to line up with C and part of D.