mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 07:10:34 +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
@@ -144,7 +144,7 @@ class Transform3d:
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Device = "cpu",
|
||||
matrix: Optional[torch.Tensor] = None,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Args:
|
||||
dtype: The data type of the transformation matrix.
|
||||
@@ -176,7 +176,7 @@ class Transform3d:
|
||||
self.device = make_device(device)
|
||||
self.dtype = dtype
|
||||
|
||||
def __len__(self):
|
||||
def __len__(self) -> int:
|
||||
return self.get_matrix().shape[0]
|
||||
|
||||
def __getitem__(
|
||||
@@ -462,7 +462,7 @@ class Translate(Transform3d):
|
||||
z=None,
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Optional[Device] = None,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Create a new Transform3d representing 3D translations.
|
||||
|
||||
@@ -503,7 +503,7 @@ class Scale(Transform3d):
|
||||
z=None,
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Optional[Device] = None,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
A Transform3d representing a scaling operation, with different scale
|
||||
factors along each coordinate axis.
|
||||
@@ -549,7 +549,7 @@ class Rotate(Transform3d):
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Optional[Device] = None,
|
||||
orthogonal_tol: float = 1e-5,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Create a new Transform3d representing 3D rotation using a rotation
|
||||
matrix as the input.
|
||||
@@ -589,7 +589,7 @@ class RotateAxisAngle(Rotate):
|
||||
degrees: bool = True,
|
||||
dtype: torch.dtype = torch.float64,
|
||||
device: Optional[Device] = None,
|
||||
):
|
||||
) -> None:
|
||||
"""
|
||||
Create a new Transform3d representing 3D rotation about an axis
|
||||
by an angle.
|
||||
|
||||
Reference in New Issue
Block a user