Пример #1
0
    def check(self, value):
        value_tril = batch_tril(value)
        lower_triangular = (value_tril == value).view(value.shape[:-2] + (-1,)).min(-1)[0]

        n = value.size(-1)
        diag_mask = torch.eye(n, n, out=value.new(n, n))
        positive_diagonal = (value * diag_mask > (diag_mask - 1)).min(-1)[0].min(-1)[0]
        return lower_triangular & positive_diagonal
Пример #2
0
    def check(self, value):
        value_tril = batch_tril(value)
        lower_triangular = (value_tril == value).view(value.shape[:-2] + (-1,)).min(-1)[0]

        n = value.size(-1)
        diag_mask = torch.eye(n, n, out=value.new(n, n))
        positive_diagonal = (value * diag_mask > (diag_mask - 1)).min(-1)[0].min(-1)[0]
        return lower_triangular & positive_diagonal
Пример #3
0
 def check(self, value):
     value_tril = batch_tril(value)
     return (value_tril == value).view(value.shape[:-2] + (-1, )).min(-1)[0]
Пример #4
0
 def check(self, value):
     value_tril = batch_tril(value)
     return (value_tril == value).view(value.shape[:-2] + (-1,)).min(-1)[0]