diprism / fggs

Factor Graph Grammars in Python
MIT License
13 stars 3 forks source link

Fixed Product Rule Expansion Bug in Sum-Product #73

Closed kennethsible closed 2 years ago

kennethsible commented 2 years ago

The following einsum call would produce an exception (einsum() must provide at least one operand) if the RHS of any rule in an FGG contained only a single nonterminal since that RHS cannot be expanded with the product rule algorithm.

torch.einsum(equation, *(tensors[:i] + tensors[(i + 1):]))