From 7660ed187683bff6cb21f68bf8659cd88b83062c Mon Sep 17 00:00:00 2001 From: Pyre Bot Jr <> Date: Tue, 28 Dec 2021 11:27:27 -0800 Subject: [PATCH] suppress errors in `fbcode/vision` - batch 2 Differential Revision: D33338085 fbshipit-source-id: fdb207864718c56dfa0d20530b59349c93af11bd --- pytorch3d/ops/utils.py | 6 +++++- pytorch3d/renderer/blending.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pytorch3d/ops/utils.py b/pytorch3d/ops/utils.py index 3b33b708..4d937ae1 100644 --- a/pytorch3d/ops/utils.py +++ b/pytorch3d/ops/utils.py @@ -137,7 +137,11 @@ def convert_pointclouds_to_tensor(pcl: Union[torch.Tensor, "Pointclouds"]): elif torch.is_tensor(pcl): X = pcl num_points = X.shape[1] * torch.ones( # type: ignore - X.shape[0], device=X.device, dtype=torch.int64 + # pyre-fixme[16]: Item `Pointclouds` of `Union[Pointclouds, Tensor]` has + # no attribute `shape`. + X.shape[0], + device=X.device, + dtype=torch.int64, ) else: raise ValueError( diff --git a/pytorch3d/renderer/blending.py b/pytorch3d/renderer/blending.py index 86d59db9..f2afe8aa 100644 --- a/pytorch3d/renderer/blending.py +++ b/pytorch3d/renderer/blending.py @@ -214,6 +214,8 @@ def softmax_rgb_blend( # pyre-fixme[16] zfar = zfar[:, None, None, None] if torch.is_tensor(znear): + # pyre-fixme[16]: Item `float` of `Union[float, Tensor]` has no attribute + # `__getitem__`. znear = znear[:, None, None, None] z_inv = (zfar - fragments.zbuf) / (zfar - znear) * mask