import torch


def dot_products(tensor: torch.Tensor) -> torch.Tensor:
    """
    Computes the dot product between each pair of rows in the given Tensor.
    :param tensor: the Tensor to compute the dot products between the rows of. Size [N, D].
    :return: the computed dot products, where result[i, j] = tensor[i, :] * tensor[j, :]. Size [N, N].
    """
    products = tensor[:, None, :] * tensor[None, :, :]   # [N, N, D]
    return torch.sum(products, dim=2)