Thanks for the code.
I’m a bit confused about the torch.ger call.
You are currently reshaping the output of both embedding layers to a 1-dimensional tensor.
This would also mean that you are collapsing all dimensions, including the batch dimension.
Is this what you plan to do?
Usually, you would keep the batch dimension intact, so could you explain the use case a bit, so that we could debug a bit more?