-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add missing None type hint to init functions #6354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -70,7 +70,7 @@ def __getitem__(self, index): | |||||
else: | ||||||
return img1, img2, flow | ||||||
|
||||||
def __len__(self): | ||||||
def __len__(self) -> int: | ||||||
return len(self._image_list) | ||||||
|
||||||
def __rmul__(self, v): | ||||||
|
@@ -118,7 +118,7 @@ class Sintel(FlowDataset): | |||||
return a built-in valid mask, such as :class:`~torchvision.datasets.KittiFlow`. | ||||||
""" | ||||||
|
||||||
def __init__(self, root, split="train", pass_name="clean", transforms=None): | ||||||
def __init__(self, root, split="train", pass_name="clean", transforms=None) -> None: | ||||||
super().__init__(root=root, transforms=transforms) | ||||||
|
||||||
verify_str_arg(split, "split", valid_values=("train", "test")) | ||||||
|
@@ -180,7 +180,7 @@ class KittiFlow(FlowDataset): | |||||
|
||||||
_has_builtin_flow_mask = True | ||||||
|
||||||
def __init__(self, root, split="train", transforms=None): | ||||||
def __init__(self, root, split="train", transforms=None) -> None: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same flows for all comments
Suggested change
|
||||||
super().__init__(root=root, transforms=transforms) | ||||||
|
||||||
verify_str_arg(split, "split", valid_values=("train", "test")) | ||||||
|
@@ -245,7 +245,7 @@ class FlyingChairs(FlowDataset): | |||||
return a built-in valid mask, such as :class:`~torchvision.datasets.KittiFlow`. | ||||||
""" | ||||||
|
||||||
def __init__(self, root, split="train", transforms=None): | ||||||
def __init__(self, root, split="train", transforms=None) -> None: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
super().__init__(root=root, transforms=transforms) | ||||||
|
||||||
verify_str_arg(split, "split", valid_values=("train", "val")) | ||||||
|
@@ -316,7 +316,7 @@ class FlyingThings3D(FlowDataset): | |||||
return a built-in valid mask, such as :class:`~torchvision.datasets.KittiFlow`. | ||||||
""" | ||||||
|
||||||
def __init__(self, root, split="train", pass_name="clean", camera="left", transforms=None): | ||||||
def __init__(self, root, split="train", pass_name="clean", camera="left", transforms=None) -> None: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
super().__init__(root=root, transforms=transforms) | ||||||
|
||||||
verify_str_arg(split, "split", valid_values=("train", "test")) | ||||||
|
@@ -401,7 +401,7 @@ class HD1K(FlowDataset): | |||||
|
||||||
_has_builtin_flow_mask = True | ||||||
|
||||||
def __init__(self, root, split="train", transforms=None): | ||||||
def __init__(self, root, split="train", transforms=None) -> None: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
super().__init__(root=root, transforms=transforms) | ||||||
|
||||||
verify_str_arg(split, "split", valid_values=("train", "test")) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well let's type this correctly?