Skip to content

Commit 2a9344a

Browse files
committed
Update DataLoader.cs
1 parent 04efeaf commit 2a9344a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/TorchSharp/DataLoader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ public bool MoveNext()
319319
.Where(x => x.HasValue)
320320
.Cast<long>()
321321
.ToArray();
322+
if (indices.Length is 0)
323+
return false;
322324
if (loader.drop_last && indices.Length < loader.batchSize) {
323325
return false;
324326
}

0 commit comments

Comments
 (0)