diff --git a/src/pyjuice/model/tensorcircuit.py b/src/pyjuice/model/tensorcircuit.py index 9a1994bf..302ccc6d 100644 --- a/src/pyjuice/model/tensorcircuit.py +++ b/src/pyjuice/model/tensorcircuit.py @@ -313,7 +313,7 @@ def _set_root_node_flows(): self.node_flows[self._root_node_range[0]:self._root_node_range[1],:] = root_flows else: if ll_weights.dim() == 1: - ll_weights = ll_weights.unsqueeze(1) + ll_weights = ll_weights.unsqueeze(0) assert ll_weights.size(0) == self.num_root_nodes @@ -519,6 +519,12 @@ def print_statistics(self): print(f"> Number of edges: {self.num_edges}") print(f"> Number of sum parameters: {self.num_sum_params}") + def get_node_mars(self, ns: CircuitNodes): + pass + + def get_node_flows(self, ns: CircuitNodes): + pass + def enable_partial_evaluation(self, scopes: Union[Sequence[BitSet],Sequence[int]], forward: bool = False, backward: bool = False, overwrite: bool = False): # Create scope2nid cache diff --git a/tests/layer/propagation_algs_test.py b/tests/layer/propagation_algs_test.py index 852caf0d..7d91b71a 100644 --- a/tests/layer/propagation_algs_test.py +++ b/tests/layer/propagation_algs_test.py @@ -232,7 +232,7 @@ def test_general_ll_prop(): my_pflows[layer.partitioned_pfids[0][j,:]+i] = pflows - assert torch.all(torch.abs(my_pflows - param_flows) < 4e-3) + assert torch.all(torch.abs(my_pflows - param_flows) < 6e-3) def test_mpe_prop():