Skip to content

Commit

Permalink
correct a bug in reshape code when dimensions match but mapping does …
Browse files Browse the repository at this point in the history
…not. Loosen check for randomzied svd, as it seems to fail when things are working fine.
  • Loading branch information
solomonik committed Jan 27, 2020
1 parent 8054b8e commit 12ef454
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/tensor/untyped_tensor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1687,11 +1687,11 @@ namespace CTF_int {
if (!did_lens_change){
bool is_map_changed = false;
if (topo != old_tsr->topo) is_map_changed = true;
topo = old_tsr->topo;
//topo = old_tsr->topo;
for (int i=0; i<order; i++){
if (!comp_dim_map(edge_map+i, old_tsr->edge_map+i)){
edge_map[i].clear();
copy_mapping(1, old_tsr->edge_map+i, edge_map+i);
//edge_map[i].clear();
//copy_mapping(1, old_tsr->edge_map+i, edge_map+i);
is_map_changed = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/python/test_la.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_svd_rand(self):
rs2 = ctf.vecnorm(A - ctf.dot(U2*S2,VT2))
rA = ctf.vecnorm(A)
self.assertTrue(rs1 < rA)
self.assertTrue(rs2 < rs1)
self.assertTrue((rs2 < rs1) or numpy.abs(rs1-rs2) < 1.e-4)
self.assertTrue(numpy.abs(rs1 - rs2)<3.e-1)

def test_tsvd(self):
Expand Down

0 comments on commit 12ef454

Please sign in to comment.