diff --git a/pytorch3d/common/workaround/symeig3x3.py b/pytorch3d/common/workaround/symeig3x3.py index 955aa400..937485cb 100644 --- a/pytorch3d/common/workaround/symeig3x3.py +++ b/pytorch3d/common/workaround/symeig3x3.py @@ -104,7 +104,6 @@ class _SymEig3x3(nn.Module): ) p = torch.sqrt(p2 / 6.0) - # pyrefly: ignore [unsupported-operation] B = (inputs - q[..., None, None] * self._identity) / p[..., None, None] r = torch.det(B) / 2.0 @@ -189,10 +188,8 @@ class _SymEig3x3(nn.Module): """ # Find the eigenvector corresponding to alpha0, its eigenvalue is distinct - # pyrefly: ignore [unsupported-operation] ev0 = self._get_ev0(inputs - alpha0[..., None, None] * self._identity) u, v = self._get_uv(ev0) - # pyrefly: ignore [unsupported-operation] ev1 = self._get_ev1(inputs - alpha1[..., None, None] * self._identity, u, v) # Third eigenvector is computed as the cross-product of the other two ev2 = torch.cross(ev0, ev1, dim=-1) @@ -267,7 +264,6 @@ class _SymEig3x3(nn.Module): """ min_idx = w.abs().argmin(dim=-1) - # pyrefly: ignore [bad-index] rotation_2d = self._rotations_3d[min_idx].to(w) u = F.normalize((rotation_2d @ w[..., None])[..., 0], dim=-1) diff --git a/pytorch3d/io/obj_io.py b/pytorch3d/io/obj_io.py index 36b6ff53..c1dac7f1 100644 --- a/pytorch3d/io/obj_io.py +++ b/pytorch3d/io/obj_io.py @@ -794,7 +794,7 @@ def save_obj( mtl_path = str(mtl_path) # Save texture map to output folder - # pyre-fixme[16] # undefined attribute cpu + # undefined attribute cpu texture_map = texture_map.detach().cpu() * 255.0 image = Image.fromarray(texture_map.numpy().astype(np.uint8)) with _open_file(image_path, path_manager, "wb") as im_f: diff --git a/pytorch3d/renderer/implicit/harmonic_embedding.py b/pytorch3d/renderer/implicit/harmonic_embedding.py index 47382a0c..3fc2d8a7 100644 --- a/pytorch3d/renderer/implicit/harmonic_embedding.py +++ b/pytorch3d/renderer/implicit/harmonic_embedding.py @@ -136,16 +136,13 @@ class HarmonicEmbedding(torch.nn.Module): [..., (n_harmonic_functions * 2 + int(append_input)) * num_points_per_ray] """ # [..., dim, n_harmonic_functions] - # pyrefly: ignore [unsupported-operation] embed = x[..., None] * self._frequencies # [..., 1, dim, n_harmonic_functions] + [2, 1, 1] => [..., 2, dim, n_harmonic_functions] - # pyrefly: ignore [bad-index] embed = embed[..., None, :, :] + self._zero_half_pi[..., None, None] # Use the trig identity cos(x) = sin(x + pi/2) # and do one vectorized call to sin([x, x+pi/2]) instead of (sin(x), cos(x)). embed = embed.sin() if diag_cov is not None: - # pyrefly: ignore [no-matching-overload] x_var = diag_cov[..., None] * torch.pow(self._frequencies, 2) exp_var = torch.exp(-0.5 * x_var) # [..., 2, dim, n_harmonic_functions] @@ -184,7 +181,6 @@ class HarmonicEmbedding(torch.nn.Module): """ return self.get_output_dim_static( input_dims, - # pyrefly: ignore [bad-argument-type] len(self._frequencies), self.append_input, ) diff --git a/pytorch3d/renderer/mesh/rasterizer.py b/pytorch3d/renderer/mesh/rasterizer.py index bad4e070..2f7dba9c 100644 --- a/pytorch3d/renderer/mesh/rasterizer.py +++ b/pytorch3d/renderer/mesh/rasterizer.py @@ -239,12 +239,10 @@ class MeshRasterizer(nn.Module): if raster_settings.perspective_correct is not None: perspective_correct = raster_settings.perspective_correct else: - # pyrefly: ignore [missing-attribute] perspective_correct = cameras.is_perspective() if raster_settings.z_clip_value is not None: z_clip = raster_settings.z_clip_value else: - # pyrefly: ignore [missing-attribute] znear = cameras.get_znear() if isinstance(znear, torch.Tensor): znear = znear.min().item()