Преглед изворни кода

Fix the warning in new PyTorch due to torch.bool

Yichao Zhou пре 6 година
родитељ
комит
fcfb25b463
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lcnn/models/line_vectorizer.py

+ 1 - 1
lcnn/models/line_vectorizer.py

@@ -194,7 +194,7 @@ class LineVectorizer(nn.Module):
             if do_evaluation:
                 c = (u < v).flatten()
             else:
-                c = torch.zeros_like(label)
+                c = torch.zeros_like(label, dtype=torch.bool)
 
                 # sample positive lines
                 cdx = label.nonzero().flatten()