Skip to content

Commit c6b594c

Browse files
committed
Added comment
1 parent 4661237 commit c6b594c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/torchcodec/_frame.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Frame(Iterable):
3939
"""The duration of the frame, in seconds (float)."""
4040

4141
def __post_init__(self):
42+
# This is called after __init__() when a Frame is created. We can run
43+
# input validation checks here.
4244
if not self.data.ndim == 3:
4345
raise ValueError(f"data must be 3-dimensional, got {self.data.shape = }")
4446
self.pts_seconds = float(self.pts_seconds)
@@ -64,6 +66,8 @@ class FrameBatch(Iterable):
6466
"""The duration of the frame, in seconds (1-D ``torch.Tensor`` of floats)."""
6567

6668
def __post_init__(self):
69+
# This is called after __init__() when a FrameBatch is created. We can
70+
# run input validation checks here.
6771
if self.data.ndim < 4:
6872
raise ValueError(
6973
f"data must be at least 4-dimensional. Got {self.data.shape = } "

0 commit comments

Comments
 (0)