From de3a474d2b9e0f5d4a77c82106a4a8e7853a4e07 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005307016 Date: Fri, 9 Dec 2022 18:50:58 -0800 Subject: [PATCH] suppress errors in `vision/fair/pytorch3d` Differential Revision: D41897914 fbshipit-source-id: 675f4ad6938bc12d295bbb63a69e3ff98b319a9a --- pytorch3d/loss/point_mesh_distance.py | 4 ---- pytorch3d/ops/ball_query.py | 1 - pytorch3d/ops/graph_conv.py | 1 - pytorch3d/ops/interp_face_attrs.py | 1 - pytorch3d/ops/iou_box3d.py | 1 - pytorch3d/ops/knn.py | 1 - pytorch3d/ops/marching_cubes.py | 1 - pytorch3d/ops/mesh_face_areas_normals.py | 1 - pytorch3d/ops/packed_to_padded.py | 2 -- pytorch3d/ops/points_to_volumes.py | 1 - pytorch3d/renderer/blending.py | 1 - pytorch3d/renderer/compositing.py | 3 --- pytorch3d/renderer/mesh/rasterize_meshes.py | 1 - pytorch3d/renderer/points/pulsar/renderer.py | 1 - pytorch3d/renderer/points/rasterize_points.py | 1 - 15 files changed, 21 deletions(-) diff --git a/pytorch3d/loss/point_mesh_distance.py b/pytorch3d/loss/point_mesh_distance.py index fb8169c2..fc45bc12 100644 --- a/pytorch3d/loss/point_mesh_distance.py +++ b/pytorch3d/loss/point_mesh_distance.py @@ -88,7 +88,6 @@ class _PointFaceDistance(Function): return grad_points, None, grad_tris, None, None, None -# pyre-fixme[16]: `_PointFaceDistance` has no attribute `apply`. point_face_distance = _PointFaceDistance.apply @@ -151,7 +150,6 @@ class _FacePointDistance(Function): return grad_points, None, grad_tris, None, None, None -# pyre-fixme[16]: `_FacePointDistance` has no attribute `apply`. face_point_distance = _FacePointDistance.apply @@ -202,7 +200,6 @@ class _PointEdgeDistance(Function): return grad_points, None, grad_segms, None, None -# pyre-fixme[16]: `_PointEdgeDistance` has no attribute `apply`. point_edge_distance = _PointEdgeDistance.apply @@ -253,7 +250,6 @@ class _EdgePointDistance(Function): return grad_points, None, grad_segms, None, None -# pyre-fixme[16]: `_EdgePointDistance` has no attribute `apply`. edge_point_distance = _EdgePointDistance.apply diff --git a/pytorch3d/ops/ball_query.py b/pytorch3d/ops/ball_query.py index 821df06f..af271a40 100644 --- a/pytorch3d/ops/ball_query.py +++ b/pytorch3d/ops/ball_query.py @@ -132,7 +132,6 @@ def ball_query( if lengths2 is None: lengths2 = torch.full((N,), P2, dtype=torch.int64, device=p1.device) - # pyre-fixme[16]: `_ball_query` has no attribute `apply`. dists, idx = _ball_query.apply(p1, p2, lengths1, lengths2, K, radius) # Gather the neighbors if needed diff --git a/pytorch3d/ops/graph_conv.py b/pytorch3d/ops/graph_conv.py index 600ae7ae..1d7a6186 100644 --- a/pytorch3d/ops/graph_conv.py +++ b/pytorch3d/ops/graph_conv.py @@ -171,5 +171,4 @@ class GatherScatter(Function): return grad_input, grad_edges, grad_directed -# pyre-fixme[16]: `GatherScatter` has no attribute `apply`. gather_scatter = GatherScatter.apply diff --git a/pytorch3d/ops/interp_face_attrs.py b/pytorch3d/ops/interp_face_attrs.py index 704982bb..705fc152 100644 --- a/pytorch3d/ops/interp_face_attrs.py +++ b/pytorch3d/ops/interp_face_attrs.py @@ -56,7 +56,6 @@ def interpolate_face_attributes( pix_to_face = pix_to_face.view(-1) barycentric_coords = barycentric_coords.view(N * H * W * K, 3) args = (pix_to_face, barycentric_coords, face_attributes) - # pyre-fixme[16]: `_InterpFaceAttrs` has no attribute `apply`. out = _InterpFaceAttrs.apply(*args) out = out.view(N, H, W, K, -1) return out diff --git a/pytorch3d/ops/iou_box3d.py b/pytorch3d/ops/iou_box3d.py index 707dc9a8..dbc6358b 100644 --- a/pytorch3d/ops/iou_box3d.py +++ b/pytorch3d/ops/iou_box3d.py @@ -161,7 +161,6 @@ def box3d_overlap( _check_nonzero(boxes1, eps) _check_nonzero(boxes2, eps) - # pyre-fixme[16]: `_box3d_overlap` has no attribute `apply`. vol, iou = _box3d_overlap.apply(boxes1, boxes2) return vol, iou diff --git a/pytorch3d/ops/knn.py b/pytorch3d/ops/knn.py index 747bc5a3..2b31c5cb 100644 --- a/pytorch3d/ops/knn.py +++ b/pytorch3d/ops/knn.py @@ -184,7 +184,6 @@ def knn_points( if lengths2 is None: lengths2 = torch.full((p1.shape[0],), P2, dtype=torch.int64, device=p1.device) - # pyre-fixme[16]: `_knn_points` has no attribute `apply`. p1_dists, p1_idx = _knn_points.apply( p1, p2, lengths1, lengths2, K, version, norm, return_sorted ) diff --git a/pytorch3d/ops/marching_cubes.py b/pytorch3d/ops/marching_cubes.py index eda94ec4..8ae3d16e 100644 --- a/pytorch3d/ops/marching_cubes.py +++ b/pytorch3d/ops/marching_cubes.py @@ -278,7 +278,6 @@ def marching_cubes( for i in range(len(vol_batch)): vol = vol_batch[i] thresh = ((vol.max() + vol.min()) / 2).item() if isolevel is None else isolevel - # pyre-fixme[16]: `_marching_cubes` has no attribute `apply`. verts, faces, ids = _marching_cubes.apply(vol, thresh) if len(faces) > 0 and len(verts) > 0: # Convert from world coordinates ([0, D-1], [0, H-1], [0, W-1]) to diff --git a/pytorch3d/ops/mesh_face_areas_normals.py b/pytorch3d/ops/mesh_face_areas_normals.py index c591b9be..f41ff1dc 100644 --- a/pytorch3d/ops/mesh_face_areas_normals.py +++ b/pytorch3d/ops/mesh_face_areas_normals.py @@ -63,5 +63,4 @@ class _MeshFaceAreasNormals(Function): return grad_verts, None -# pyre-fixme[16]: `_MeshFaceAreasNormals` has no attribute `apply`. mesh_face_areas_normals = _MeshFaceAreasNormals.apply diff --git a/pytorch3d/ops/packed_to_padded.py b/pytorch3d/ops/packed_to_padded.py index 7c209b5f..5072e624 100644 --- a/pytorch3d/ops/packed_to_padded.py +++ b/pytorch3d/ops/packed_to_padded.py @@ -91,7 +91,6 @@ def packed_to_padded( inputs = inputs.unsqueeze(1) else: inputs = inputs.reshape(input_shape[0], -1) - # pyre-ignore [16] inputs_padded = _PackedToPadded.apply(inputs, first_idxs, max_size) # if flat is True, reshape output to (N, max_size) from (N, max_size, 1) # else reshape output to (N, max_size, ...) @@ -188,7 +187,6 @@ def padded_to_packed( inputs = inputs.unsqueeze(2) else: inputs = inputs.reshape(*input_shape[:2], -1) - # pyre-ignore [16] inputs_packed = _PaddedToPacked.apply(inputs, first_idxs, num_inputs) # if input is flat, reshape output to (F,) from (F, 1) # else reshape output to (F, ...) diff --git a/pytorch3d/ops/points_to_volumes.py b/pytorch3d/ops/points_to_volumes.py index 49b5e24b..24970255 100644 --- a/pytorch3d/ops/points_to_volumes.py +++ b/pytorch3d/ops/points_to_volumes.py @@ -183,7 +183,6 @@ class _points_to_volumes_function(Function): ) -# pyre-fixme[16]: `_points_to_volumes_function` has no attribute `apply`. _points_to_volumes = _points_to_volumes_function.apply diff --git a/pytorch3d/renderer/blending.py b/pytorch3d/renderer/blending.py index 1a7cbc9a..07c92437 100644 --- a/pytorch3d/renderer/blending.py +++ b/pytorch3d/renderer/blending.py @@ -108,7 +108,6 @@ class _SigmoidAlphaBlend(torch.autograd.Function): return grad_dists, None, None -# pyre-fixme[16]: `_SigmoidAlphaBlend` has no attribute `apply`. _sigmoid_alpha = _SigmoidAlphaBlend.apply diff --git a/pytorch3d/renderer/compositing.py b/pytorch3d/renderer/compositing.py index 79cca1d5..669108e6 100644 --- a/pytorch3d/renderer/compositing.py +++ b/pytorch3d/renderer/compositing.py @@ -90,7 +90,6 @@ def alpha_composite(pointsidx, alphas, pt_clds) -> torch.Tensor: Combined features: Tensor of shape (N, C, image_size, image_size) giving the accumulated features at each point. """ - # pyre-fixme[16]: `_CompositeAlphaPoints` has no attribute `apply`. return _CompositeAlphaPoints.apply(pt_clds, alphas, pointsidx) @@ -169,7 +168,6 @@ def norm_weighted_sum(pointsidx, alphas, pt_clds) -> torch.Tensor: Combined features: Tensor of shape (N, C, image_size, image_size) giving the accumulated features at each point. """ - # pyre-fixme[16]: `_CompositeNormWeightedSumPoints` has no attribute `apply`. return _CompositeNormWeightedSumPoints.apply(pt_clds, alphas, pointsidx) @@ -241,5 +239,4 @@ def weighted_sum(pointsidx, alphas, pt_clds) -> torch.Tensor: Combined features: Tensor of shape (N, C, image_size, image_size) giving the accumulated features at each point. """ - # pyre-fixme[16]: `_CompositeWeightedSumPoints` has no attribute `apply`. return _CompositeWeightedSumPoints.apply(pt_clds, alphas, pointsidx) diff --git a/pytorch3d/renderer/mesh/rasterize_meshes.py b/pytorch3d/renderer/mesh/rasterize_meshes.py index 1a1ff251..afcd7496 100644 --- a/pytorch3d/renderer/mesh/rasterize_meshes.py +++ b/pytorch3d/renderer/mesh/rasterize_meshes.py @@ -220,7 +220,6 @@ def rasterize_meshes( if max_faces_per_bin is None: max_faces_per_bin = int(max(10000, meshes._F / 5)) - # pyre-fixme[16]: `_RasterizeFaceVerts` has no attribute `apply`. pix_to_face, zbuf, barycentric_coords, dists = _RasterizeFaceVerts.apply( face_verts, mesh_to_face_first_idx, diff --git a/pytorch3d/renderer/points/pulsar/renderer.py b/pytorch3d/renderer/points/pulsar/renderer.py index 9294ec0b..9ba7dfd5 100644 --- a/pytorch3d/renderer/points/pulsar/renderer.py +++ b/pytorch3d/renderer/points/pulsar/renderer.py @@ -628,7 +628,6 @@ class Renderer(torch.nn.Module): max_depth / focal_lengths.min().item(), ) ) - # pyre-fixme[16]: `_Render` has no attribute `apply`. ret_res = _Render.apply( vert_pos, vert_col, diff --git a/pytorch3d/renderer/points/rasterize_points.py b/pytorch3d/renderer/points/rasterize_points.py index 97cc8129..08211049 100644 --- a/pytorch3d/renderer/points/rasterize_points.py +++ b/pytorch3d/renderer/points/rasterize_points.py @@ -128,7 +128,6 @@ def rasterize_points( # Function.apply cannot take keyword args, so we handle defaults in this # wrapper and call apply with positional args only - # pyre-fixme[16]: `_RasterizePoints` has no attribute `apply`. return _RasterizePoints.apply( points_packed, cloud_to_packed_first_idx,