def compute_contracted_indices(ndims0):
    """During matrix multiplication the last index of the first tensor gets
    contracted with the first index of the second tensor."""
    return ndims0 - 1, 0