Skip to content

Commit 46a0b5b

Browse files
author
Daniel Flores
committed
subtract epsilon in torch.arange
1 parent b0e9772 commit 46a0b5b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/torchcodec/samplers/_time_based.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,8 @@ def _generic_time_based_sampler(
204204
clip_start_seconds = torch.arange(
205205
sampling_range_start,
206206
sampling_range_end, # excluded
207-
seconds_between_clip_starts,
207+
seconds_between_clip_starts - 1e-6,
208208
)
209-
if clip_start_seconds[-1] >= sampling_range_end:
210-
clip_start_seconds = clip_start_seconds[:-1]
211209
num_clips = len(clip_start_seconds)
212210

213211
all_clips_timestamps = _build_all_clips_timestamps(

0 commit comments

Comments
 (0)