seen[x] = (color_id[x], k // width, k % width)
square_infos = tuple(zip(*seen.values()))
- square_c = torch.tensor(square_infos[0])
- square_i = torch.tensor(square_infos[1])
- square_j = torch.tensor(square_infos[2])
+ if square_infos:
+ square_c = torch.tensor(square_infos[0])
+ square_i = torch.tensor(square_infos[1])
+ square_j = torch.tensor(square_infos[2])
+ else:
+ square_c = torch.tensor([])
+ square_i = torch.tensor([])
+ square_j = torch.tensor([])
s = all_properties(height, width, len(seen), square_i, square_j, square_c)