mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 11:52:50 +08:00
suppress errors in vision/fair/pytorch3d
Differential Revision: D30479084 fbshipit-source-id: 6b22dd0afe4dfb1be6249e43a56657519f11dcf1
This commit is contained in:
parent
1ea2b7272a
commit
fadec970c9
@ -144,7 +144,10 @@ def compute_extrinsic_matrix(azimuth, elevation, distance): # pragma: no cover
|
||||
|
||||
|
||||
def read_binvox_coords(
|
||||
f, integer_division: bool = True, dtype: torch.dtype = torch.float32
|
||||
f,
|
||||
integer_division: bool = True,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
): # pragma: no cover
|
||||
"""
|
||||
Copied from meshrcnn codebase:
|
||||
|
@ -576,12 +576,21 @@ def _load_obj(
|
||||
mtl_path,
|
||||
) = _parse_obj(f_obj, data_dir)
|
||||
|
||||
# pyre-fixme[6]: Expected `dtype` for 3rd param but got `Type[torch.float32]`.
|
||||
verts = _make_tensor(verts, cols=3, dtype=torch.float32, device=device) # (V, 3)
|
||||
normals = _make_tensor(
|
||||
normals, cols=3, dtype=torch.float32, device=device
|
||||
normals,
|
||||
cols=3,
|
||||
# pyre-fixme[6]: Expected `dtype` for 3rd param but got `Type[torch.float32]`.
|
||||
dtype=torch.float32,
|
||||
device=device,
|
||||
) # (N, 3)
|
||||
verts_uvs = _make_tensor(
|
||||
verts_uvs, cols=2, dtype=torch.float32, device=device
|
||||
verts_uvs,
|
||||
cols=2,
|
||||
# pyre-fixme[6]: Expected `dtype` for 3rd param but got `Type[torch.float32]`.
|
||||
dtype=torch.float32,
|
||||
device=device,
|
||||
) # (T, 2)
|
||||
|
||||
faces_verts_idx = _format_faces_indices(
|
||||
|
@ -884,6 +884,7 @@ def _get_verts(
|
||||
and vertex[0].ndim == 2
|
||||
and vertex[0].shape[1] == 3
|
||||
):
|
||||
# pyre-fixme[6]: Expected `dtype` for 3rd param but got `Type[torch.float32]`.
|
||||
return _make_tensor(vertex[0], cols=3, dtype=torch.float32), None, None
|
||||
|
||||
vertex_colors = None
|
||||
|
@ -58,6 +58,7 @@ def eyes(
|
||||
dim: int,
|
||||
N: int,
|
||||
device: Optional[torch.device] = None,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
) -> torch.Tensor:
|
||||
"""
|
||||
|
@ -253,6 +253,8 @@ class CamerasBase(TensorProperties):
|
||||
input points to the renderer to be in NDC space.
|
||||
"""
|
||||
if self.in_ndc():
|
||||
# pyre-fixme[6]: Expected `dtype` for 2nd param but got
|
||||
# `Type[torch.float32]`.
|
||||
return Transform3d(device=self.device, dtype=torch.float32)
|
||||
else:
|
||||
# For custom cameras which can be defined in screen space,
|
||||
@ -1031,6 +1033,8 @@ class PerspectiveCameras(CamerasBase):
|
||||
i.e. +X left, +Y up.
|
||||
"""
|
||||
if self.in_ndc():
|
||||
# pyre-fixme[6]: Expected `dtype` for 2nd param but got
|
||||
# `Type[torch.float32]`.
|
||||
ndc_transform = Transform3d(device=self.device, dtype=torch.float32)
|
||||
else:
|
||||
# when cameras are defined in screen/image space, the principal point is
|
||||
@ -1229,6 +1233,8 @@ class OrthographicCameras(CamerasBase):
|
||||
i.e. +X left, +Y up.
|
||||
"""
|
||||
if self.in_ndc():
|
||||
# pyre-fixme[6]: Expected `dtype` for 2nd param but got
|
||||
# `Type[torch.float32]`.
|
||||
ndc_transform = Transform3d(device=self.device, dtype=torch.float32)
|
||||
else:
|
||||
# when cameras are defined in screen/image space, the principal point is
|
||||
|
@ -95,7 +95,11 @@ class TensorProperties(nn.Module):
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, dtype: torch.dtype = torch.float32, device: Device = "cpu", **kwargs
|
||||
self,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Device = "cpu",
|
||||
**kwargs,
|
||||
) -> None:
|
||||
"""
|
||||
Args:
|
||||
@ -273,7 +277,10 @@ class TensorProperties(nn.Module):
|
||||
|
||||
|
||||
def format_tensor(
|
||||
input, dtype: torch.dtype = torch.float32, device: Device = "cpu"
|
||||
input,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Device = "cpu",
|
||||
) -> torch.Tensor:
|
||||
"""
|
||||
Helper function for converting a scalar value to a tensor.
|
||||
@ -301,7 +308,10 @@ def format_tensor(
|
||||
|
||||
|
||||
def convert_to_tensors_and_broadcast(
|
||||
*args, dtype: torch.dtype = torch.float32, device: Device = "cpu"
|
||||
*args,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Device = "cpu",
|
||||
):
|
||||
"""
|
||||
Helper function to handle parsing an arbitrary number of inputs (*args)
|
||||
|
@ -142,6 +142,7 @@ class Transform3d:
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Device = "cpu",
|
||||
matrix: Optional[torch.Tensor] = None,
|
||||
@ -461,6 +462,7 @@ class Translate(Transform3d):
|
||||
x,
|
||||
y=None,
|
||||
z=None,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Optional[Device] = None,
|
||||
) -> None:
|
||||
@ -502,6 +504,7 @@ class Scale(Transform3d):
|
||||
x,
|
||||
y=None,
|
||||
z=None,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Optional[Device] = None,
|
||||
) -> None:
|
||||
@ -547,6 +550,7 @@ class Rotate(Transform3d):
|
||||
def __init__(
|
||||
self,
|
||||
R: torch.Tensor,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float32]`.
|
||||
dtype: torch.dtype = torch.float32,
|
||||
device: Optional[Device] = None,
|
||||
orthogonal_tol: float = 1e-5,
|
||||
@ -588,6 +592,7 @@ class RotateAxisAngle(Rotate):
|
||||
angle,
|
||||
axis: str = "X",
|
||||
degrees: bool = True,
|
||||
# pyre-fixme[9]: dtype has type `dtype`; used as `Type[torch.float64]`.
|
||||
dtype: torch.dtype = torch.float64,
|
||||
device: Optional[Device] = None,
|
||||
) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user