"docker/vscode:/vscode.git/clone" did not exist on "9fffcbc9cdc79736b866d17d0243f4eef7b7cadf"
Commit e4039aa5 authored by Patrick Labatut's avatar Patrick Labatut Committed by Facebook GitHub Bot
Browse files

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
parent de72049f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
def mesh_normal_consistency(meshes): def mesh_normal_consistency(meshes):
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# This source code is licensed under the BSD-style license found in the # This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`.
from pytorch3d import _C from pytorch3d import _C
from pytorch3d.structures import Meshes, Pointclouds from pytorch3d.structures import Meshes, Pointclouds
from torch.autograd import Function from torch.autograd import Function
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import torch import torch
import torch.nn as nn import torch.nn as nn
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from torch.autograd import Function from torch.autograd import Function
from torch.autograd.function import once_differentiable from torch.autograd.function import once_differentiable
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from torch.autograd import Function from torch.autograd import Function
from torch.autograd.function import once_differentiable from torch.autograd.function import once_differentiable
......
...@@ -8,7 +8,7 @@ from collections import namedtuple ...@@ -8,7 +8,7 @@ from collections import namedtuple
from typing import Union from typing import Union
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from torch.autograd import Function from torch.autograd import Function
from torch.autograd.function import once_differentiable from torch.autograd.function import once_differentiable
...@@ -58,7 +58,6 @@ class _knn_points(Function): ...@@ -58,7 +58,6 @@ class _knn_points(Function):
in p2 has fewer than K points and where a cloud in p1 has fewer than P1 points. in p2 has fewer than K points and where a cloud in p1 has fewer than P1 points.
""" """
# pyre-fixme[16]: Module `pytorch3d` has no attribute `_C`.
idx, dists = _C.knn_points_idx(p1, p2, lengths1, lengths2, K, version) idx, dists = _C.knn_points_idx(p1, p2, lengths1, lengths2, K, version)
# sort KNN in ascending order if K > 1 # sort KNN in ascending order if K > 1
...@@ -74,6 +73,7 @@ class _knn_points(Function): ...@@ -74,6 +73,7 @@ class _knn_points(Function):
dists[mask] = 0 dists[mask] = 0
else: else:
dists, sort_idx = dists.sort(dim=2) dists, sort_idx = dists.sort(dim=2)
# pyre-fixme[16]: `Tensor` has no attribute `gather`.
idx = idx.gather(2, sort_idx) idx = idx.gather(2, sort_idx)
ctx.save_for_backward(p1, p2, lengths1, lengths2, idx) ctx.save_for_backward(p1, p2, lengths1, lengths2, idx)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from torch.autograd import Function from torch.autograd import Function
from torch.autograd.function import once_differentiable from torch.autograd.function import once_differentiable
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from torch.autograd import Function from torch.autograd import Function
from torch.autograd.function import once_differentiable from torch.autograd.function import once_differentiable
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
from typing import NamedTuple, Sequence, Union from typing import NamedTuple, Sequence, Union
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
# Example functions for blending the top K colors per pixel using the outputs # Example functions for blending the top K colors per pixel using the outputs
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
# Example functions for blending the top K features per pixel using the outputs # Example functions for blending the top K features per pixel using the outputs
......
...@@ -9,7 +9,7 @@ from typing import List, Optional, Tuple, Union ...@@ -9,7 +9,7 @@ from typing import List, Optional, Tuple, Union
import numpy as np import numpy as np
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from .clip import ( from .clip import (
ClipFrustum, ClipFrustum,
......
...@@ -16,7 +16,7 @@ import warnings ...@@ -16,7 +16,7 @@ import warnings
from typing import Optional, Tuple, Union from typing import Optional, Tuple, Union
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from pytorch3d.transforms import axis_angle_to_matrix, rotation_6d_to_matrix from pytorch3d.transforms import axis_angle_to_matrix, rotation_6d_to_matrix
......
...@@ -8,7 +8,7 @@ from typing import List, Optional, Tuple, Union ...@@ -8,7 +8,7 @@ from typing import List, Optional, Tuple, Union
import numpy as np import numpy as np
import torch import torch
from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d import _C
from pytorch3d.renderer.mesh.rasterize_meshes import pix_to_non_square_ndc from pytorch3d.renderer.mesh.rasterize_meshes import pix_to_non_square_ndc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment