def test_write_then_read_compressed(self): file_outs_2 = [".tns", ".mtx", ".ttx", ".rb"] for out_type in file_outs_2: idx = 0 for t, fp in zip(self.comp_tensors, self.names): pt.write(fp + out_type, t) self.assertEqual(self.comp_tensors[idx], pt.read(fp + out_type, pt.csc)) idx += 1
def test_write_then_read_dense(self): file_outs = [".tns", ".mtx", ".ttx"] for out_type in file_outs: idx = 0 for t, fp in zip(self.tensors, self.names): pt.write(fp + out_type, t) self.assertEqual(self.tensors[idx], pt.read(fp + out_type, pt.dense)) idx += 1