Open patfl84 opened 3 months ago
Hi, there is an bug in the SAM code, line 227: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/cdt/causality/graph/SAM.py#L227
skeleton = th.from_numpy(skeleton.astype('float32')) AttributeError: 'Tensor' object has no attribute 'astype'
However, skeleton is already casted to a torch.Tensor in line 510, before it goes to line 227: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/cdt/causality/graph/SAM.py#L510
if graph is not None: skeleton = th.Tensor(nx.adjacency_matrix(graph, nodelist=list(data.columns)).todense())
Hi, there is an bug in the SAM code, line 227: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/cdt/causality/graph/SAM.py#L227
However, skeleton is already casted to a torch.Tensor in line 510, before it goes to line 227: https://github.com/FenTechSolutions/CausalDiscoveryToolbox/blob/master/cdt/causality/graph/SAM.py#L510