def outer(x: T.FloatTensor, y: T.FloatTensor) -> T.FloatTensor:
"""
Compute the outer product of vectors x and y.
mat_{ij} = x_i * y_j
Args:
x: A vector (i.e., a 1D tensor).
y: A vector (i.e., a 1D tensor).
Returns:
tensor: Outer product of vectors x and y.
"""
return torch.ger(x, y)
评论列表
文章目录