tfep.utils.math.batchwise_outer

tfep.utils.math.batchwise_outer(x1, x2)[source]

Batchwise outer product.

Parameters:
  • x1 (torch.Tensor) – A tensor of shape (*, N).

  • x2 (torch.Tensor) – A tensor of shape (*, N).

Returns:

result – A tensor shape (*, N, N), where result[..., i, j] is the outer product between x1[..., i] and x2[..., j].

Return type:

torch.Tensor