mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-14 11:26:24 +08:00
Annotate dunder functions
Summary: Annotate the (return type of the) following dunder functions across the codebase: `__init__()`, `__len__()`, `__getitem__()` Reviewed By: nikhilaravi Differential Revision: D29001801 fbshipit-source-id: 928d9e1c417ffe01ab8c0445311287786e997c7c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
35855bf860
commit
64289a491d
@@ -36,7 +36,7 @@ class ListDataset(Dataset):
|
||||
A simple dataset made of a list of entries.
|
||||
"""
|
||||
|
||||
def __init__(self, entries: List):
|
||||
def __init__(self, entries: List) -> None:
|
||||
"""
|
||||
Args:
|
||||
entries: The list of dataset entries.
|
||||
@@ -45,7 +45,7 @@ class ListDataset(Dataset):
|
||||
|
||||
def __len__(
|
||||
self,
|
||||
):
|
||||
) -> int:
|
||||
return len(self._entries)
|
||||
|
||||
def __getitem__(self, index):
|
||||
|
||||
@@ -22,7 +22,7 @@ class AverageMeter:
|
||||
Tracks the exact history of the added values in every epoch.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
"""
|
||||
Initialize the structure with empty history and zero-ed moving average.
|
||||
"""
|
||||
@@ -110,7 +110,7 @@ class Stats:
|
||||
verbose: bool = False,
|
||||
epoch: int = -1,
|
||||
plot_file: Optional[str] = None,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Args:
|
||||
log_vars: The list of variable names to be logged.
|
||||
|
||||
Reference in New Issue
Block a user