Skip to content

Commit e4039aa

Browse files
patricklabatutfacebook-github-bot
authored andcommitted
Remove _C pyre fixmes
Summary: Get rid of pyre fixmes related to importing a native module: - add stub file for the `_C` native extension to the internal typeshed - add initial annotations to the new stub file - remove the now unnecessary pyre ignores Reviewed By: nikhilaravi Differential Revision: D28929467 fbshipit-source-id: 6525e15c8f27215a3ff6f78392925fd0ed6ec2ac
1 parent de72049 commit e4039aa

12 files changed

+12
-13
lines changed

pytorch3d/loss/mesh_normal_consistency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
8+
from pytorch3d import _C
99

1010

1111
def mesh_normal_consistency(meshes):

pytorch3d/loss/point_mesh_distance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
87
from pytorch3d import _C
98
from pytorch3d.structures import Meshes, Pointclouds
109
from torch.autograd import Function

pytorch3d/ops/graph_conv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import torch
99
import torch.nn as nn
10-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
10+
from pytorch3d import _C
1111
from torch.autograd import Function
1212
from torch.autograd.function import once_differentiable
1313

pytorch3d/ops/interp_face_attrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
8+
from pytorch3d import _C
99
from torch.autograd import Function
1010
from torch.autograd.function import once_differentiable
1111

pytorch3d/ops/knn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import Union
99

1010
import torch
11-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
11+
from pytorch3d import _C
1212
from torch.autograd import Function
1313
from torch.autograd.function import once_differentiable
1414

@@ -58,7 +58,6 @@ def forward(
5858
in p2 has fewer than K points and where a cloud in p1 has fewer than P1 points.
5959
"""
6060

61-
# pyre-fixme[16]: Module `pytorch3d` has no attribute `_C`.
6261
idx, dists = _C.knn_points_idx(p1, p2, lengths1, lengths2, K, version)
6362

6463
# sort KNN in ascending order if K > 1
@@ -74,6 +73,7 @@ def forward(
7473
dists[mask] = 0
7574
else:
7675
dists, sort_idx = dists.sort(dim=2)
76+
# pyre-fixme[16]: `Tensor` has no attribute `gather`.
7777
idx = idx.gather(2, sort_idx)
7878

7979
ctx.save_for_backward(p1, p2, lengths1, lengths2, idx)

pytorch3d/ops/mesh_face_areas_normals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
8+
from pytorch3d import _C
99
from torch.autograd import Function
1010
from torch.autograd.function import once_differentiable
1111

pytorch3d/ops/packed_to_padded.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
8+
from pytorch3d import _C
99
from torch.autograd import Function
1010
from torch.autograd.function import once_differentiable
1111

pytorch3d/renderer/blending.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import NamedTuple, Sequence, Union
99

1010
import torch
11-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
11+
from pytorch3d import _C
1212

1313

1414
# Example functions for blending the top K colors per pixel using the outputs

pytorch3d/renderer/compositing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
8+
from pytorch3d import _C
99

1010

1111
# Example functions for blending the top K features per pixel using the outputs

pytorch3d/renderer/mesh/rasterize_meshes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import numpy as np
1111
import torch
12-
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
12+
from pytorch3d import _C
1313

1414
from .clip import (
1515
ClipFrustum,

0 commit comments

Comments
 (0)