Skip to content

Commit 1e53952

Browse files
authored
Fix the dataset test failures (#9327)
1 parent 269805e commit 1e53952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/datasets/_optical_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ def _read_flo(file_name: str) -> np.ndarray:
503503
if magic != b"PIEH":
504504
raise ValueError("Magic number incorrect. Invalid .flo file")
505505

506-
w = int(np.fromfile(f, "<i4", count=1))
507-
h = int(np.fromfile(f, "<i4", count=1))
506+
w = np.fromfile(f, "<i4", count=1).item()
507+
h = np.fromfile(f, "<i4", count=1).item()
508508
data = np.fromfile(f, "<f4", count=2 * w * h)
509509
return data.reshape(h, w, 2).transpose(2, 0, 1)
510510

0 commit comments

Comments
 (0)