mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-03-15 17:05:58 +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
@@ -25,7 +25,7 @@ class TensorAccessor(nn.Module):
|
||||
and one element in the batch needs to be modified.
|
||||
"""
|
||||
|
||||
def __init__(self, class_object, index: Union[int, slice]):
|
||||
def __init__(self, class_object, index: Union[int, slice]) -> None:
|
||||
"""
|
||||
Args:
|
||||
class_object: this should be an instance of a class which has
|
||||
@@ -96,7 +96,7 @@ class TensorProperties(nn.Module):
|
||||
|
||||
def __init__(
|
||||
self, dtype: torch.dtype = torch.float32, device: Device = "cpu", **kwargs
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Args:
|
||||
dtype: data type to set for the inputs
|
||||
@@ -143,7 +143,7 @@ class TensorProperties(nn.Module):
|
||||
def isempty(self) -> bool:
|
||||
return self._N == 0
|
||||
|
||||
def __getitem__(self, index: Union[int, slice]):
|
||||
def __getitem__(self, index: Union[int, slice]) -> TensorAccessor:
|
||||
"""
|
||||
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user