ソースを参照

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()