I have two vectors
a.shape = [4,6000,1000]
b.shape = [4,6000,1000]
And I would like to preform subtraction between all row-pairs.
I.e for
[[1,2,3] - [[3,4,5]
[3,4,5]] [6,7,8]]
[[-2,-2,-2],[-5,-5,-5]
[0,0,0],[-3,-3,-3]]
Using unsqueeze I was able to do so, with the following scheme:
a.unsqueeze(1) - b.unsqueeze(2)
And it works as expected.
Unfortunately, with the specified shapes, I have
CUDA out of memory. Tried to allocate 724.37 GiB
Is there a way to do it, even if slower, in a vectorized manner?