Is there any operation that can achieve the following:
import torch

batch_size = 2
seq_len = 2
dim = 3
# batch of squences of embedding vecs:
x = torch.rand([batch_size, seq_len, dim])
# batch of target embedding vecs:
y = torch.rand([batch_size, dim])

# the computation I want to achieve:
print(torch.outer(x[0][0], y[0]))
print(torch.outer(x[0][1], y[0]))
print(torch.outer(x[1][0], y[1]))
print(torch.outer(x[1][1], y[1]))
print()

# what I've tried but failed:
#print(torch.einsum('bij, bj->bij', x, y))
# or
#print(torch.einsum('bij, bj->bijk', x, y))