diprism / fggs

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

Error in sum_product #78

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

73 introduced a new bug:

    def test_newton_1(self):
        self.assertAlmostEqual(sum_product(self.fgg_1, method='newton').item(), 1.0, places=2)

gives the error

  File ".../fggs/sum_product.py", line 147, in J
    tau_R.append(torch.stack(x).sum())
RuntimeError: stack expects each tensor to be equal size, but got [] at entry 0 and [6] at entry 1
kennethsible commented 2 years ago

Fixed by #80