Kaynağa Gözat

Fix the warning in new PyTorch due to torch.bool

Yichao Zhou 6 yıl önce
ebeveyn
işleme
fcfb25b463
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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()