I have a tensor of shape (batch_size, num_steps, hidden_size). For each row vector in each matrix (num_steps, hidden_size) I want to compute the element-wise product with every other row vector, yielding a tensor of shape (batch_size, num_steps, num_steps, hidden_size).
Is there a built-in way to do this that avoids for loops?