From 8e1bcd55686a1a1d3249a0482669531dbe708aa2 Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Wed, 17 Mar 2021 09:22:49 -0700 Subject: [PATCH] Tidy comments around imports Summary: Make black and isort stop disagreeing by removing some unneeded comments around import statements. pyre ignores are moved. Reviewed By: theschnitz Differential Revision: D27118137 fbshipit-source-id: 9926d0f21142adcf9b5cfe1d394754317f6386df --- docs/examples/pulsar_basic_unified.py | 5 +---- docs/examples/pulsar_cam_unified.py | 5 +---- docs/examples/pulsar_optimization_unified.py | 5 +---- docs/tutorials/utils/generate_cow_renders.py | 2 -- pytorch3d/loss/mesh_normal_consistency.py | 4 +--- pytorch3d/ops/graph_conv.py | 4 +--- pytorch3d/ops/interp_face_attrs.py | 4 +--- pytorch3d/ops/knn.py | 4 +--- pytorch3d/ops/mesh_face_areas_normals.py | 4 +--- pytorch3d/ops/packed_to_padded.py | 4 +--- pytorch3d/renderer/blending.py | 4 +--- pytorch3d/renderer/compositing.py | 4 +--- pytorch3d/renderer/mesh/rasterize_meshes.py | 4 +--- pytorch3d/renderer/points/pulsar/renderer.py | 4 +--- pytorch3d/renderer/points/rasterize_points.py | 4 +--- 15 files changed, 14 insertions(+), 47 deletions(-) diff --git a/docs/examples/pulsar_basic_unified.py b/docs/examples/pulsar_basic_unified.py index f58c1e20..d0237270 100755 --- a/docs/examples/pulsar_basic_unified.py +++ b/docs/examples/pulsar_basic_unified.py @@ -11,11 +11,8 @@ from os import path import imageio import torch - -# Import `look_at_view_transform` as needed in the suggestion later in the -# example. -from pytorch3d.renderer import PerspectiveCameras # , look_at_view_transform from pytorch3d.renderer import ( + PerspectiveCameras, PointsRasterizationSettings, PointsRasterizer, PulsarPointsRenderer, diff --git a/docs/examples/pulsar_cam_unified.py b/docs/examples/pulsar_cam_unified.py index b0c451b0..578b891a 100755 --- a/docs/examples/pulsar_cam_unified.py +++ b/docs/examples/pulsar_cam_unified.py @@ -16,10 +16,7 @@ import cv2 import imageio import numpy as np import torch - -# Import `look_at_view_transform` as needed in the suggestion later in the -# example. -from pytorch3d.renderer.cameras import PerspectiveCameras # , look_at_view_transform +from pytorch3d.renderer.cameras import PerspectiveCameras from pytorch3d.renderer.points import ( PointsRasterizationSettings, PointsRasterizer, diff --git a/docs/examples/pulsar_optimization_unified.py b/docs/examples/pulsar_optimization_unified.py index 1cec4629..abcc5d85 100755 --- a/docs/examples/pulsar_optimization_unified.py +++ b/docs/examples/pulsar_optimization_unified.py @@ -15,10 +15,7 @@ import cv2 import imageio import numpy as np import torch - -# Import `look_at_view_transform` as needed in the suggestion later in the -# example. -from pytorch3d.renderer.cameras import PerspectiveCameras # , look_at_view_transform +from pytorch3d.renderer.cameras import PerspectiveCameras from pytorch3d.renderer.points import ( PointsRasterizationSettings, PointsRasterizer, diff --git a/docs/tutorials/utils/generate_cow_renders.py b/docs/tutorials/utils/generate_cow_renders.py index b24e9efb..b39deb87 100644 --- a/docs/tutorials/utils/generate_cow_renders.py +++ b/docs/tutorials/utils/generate_cow_renders.py @@ -4,8 +4,6 @@ import os import numpy as np import torch - -# Util function for loading meshes from pytorch3d.io import load_objs_as_meshes from pytorch3d.renderer import ( BlendParams, diff --git a/pytorch3d/loss/mesh_normal_consistency.py b/pytorch3d/loss/mesh_normal_consistency.py index c20e73f5..49c9027e 100644 --- a/pytorch3d/loss/mesh_normal_consistency.py +++ b/pytorch3d/loss/mesh_normal_consistency.py @@ -1,9 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. def mesh_normal_consistency(meshes): diff --git a/pytorch3d/ops/graph_conv.py b/pytorch3d/ops/graph_conv.py index e9bfa6c5..02e2a131 100644 --- a/pytorch3d/ops/graph_conv.py +++ b/pytorch3d/ops/graph_conv.py @@ -3,9 +3,7 @@ import torch import torch.nn as nn - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from torch.autograd import Function from torch.autograd.function import once_differentiable diff --git a/pytorch3d/ops/interp_face_attrs.py b/pytorch3d/ops/interp_face_attrs.py index 5d8fe06c..da11b0df 100644 --- a/pytorch3d/ops/interp_face_attrs.py +++ b/pytorch3d/ops/interp_face_attrs.py @@ -1,9 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from torch.autograd import Function from torch.autograd.function import once_differentiable diff --git a/pytorch3d/ops/knn.py b/pytorch3d/ops/knn.py index 1921d194..4f3df23a 100644 --- a/pytorch3d/ops/knn.py +++ b/pytorch3d/ops/knn.py @@ -4,9 +4,7 @@ from collections import namedtuple from typing import Union import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from torch.autograd import Function from torch.autograd.function import once_differentiable diff --git a/pytorch3d/ops/mesh_face_areas_normals.py b/pytorch3d/ops/mesh_face_areas_normals.py index 0490e5bb..43ce33e7 100644 --- a/pytorch3d/ops/mesh_face_areas_normals.py +++ b/pytorch3d/ops/mesh_face_areas_normals.py @@ -1,9 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from torch.autograd import Function from torch.autograd.function import once_differentiable diff --git a/pytorch3d/ops/packed_to_padded.py b/pytorch3d/ops/packed_to_padded.py index b3638119..cf92d54f 100644 --- a/pytorch3d/ops/packed_to_padded.py +++ b/pytorch3d/ops/packed_to_padded.py @@ -1,9 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from torch.autograd import Function from torch.autograd.function import once_differentiable diff --git a/pytorch3d/renderer/blending.py b/pytorch3d/renderer/blending.py index 952f68c8..23df9800 100644 --- a/pytorch3d/renderer/blending.py +++ b/pytorch3d/renderer/blending.py @@ -4,9 +4,7 @@ from typing import NamedTuple, Sequence import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. # Example functions for blending the top K colors per pixel using the outputs diff --git a/pytorch3d/renderer/compositing.py b/pytorch3d/renderer/compositing.py index aec75ebc..675d8f8d 100644 --- a/pytorch3d/renderer/compositing.py +++ b/pytorch3d/renderer/compositing.py @@ -1,9 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. # Example functions for blending the top K features per pixel using the outputs diff --git a/pytorch3d/renderer/mesh/rasterize_meshes.py b/pytorch3d/renderer/mesh/rasterize_meshes.py index 34a2f612..5d37d1da 100644 --- a/pytorch3d/renderer/mesh/rasterize_meshes.py +++ b/pytorch3d/renderer/mesh/rasterize_meshes.py @@ -5,9 +5,7 @@ from typing import List, Optional, Tuple, Union import numpy as np import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from .clip import ( ClipFrustum, diff --git a/pytorch3d/renderer/points/pulsar/renderer.py b/pytorch3d/renderer/points/pulsar/renderer.py index 34b2a5e4..4f7f6f54 100644 --- a/pytorch3d/renderer/points/pulsar/renderer.py +++ b/pytorch3d/renderer/points/pulsar/renderer.py @@ -11,9 +11,7 @@ import warnings from typing import Optional, Tuple, Union import torch - -# pyre-fixme[21]: Could not find a name `_C` defined in module `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d.transforms import axis_angle_to_matrix, rotation_6d_to_matrix diff --git a/pytorch3d/renderer/points/rasterize_points.py b/pytorch3d/renderer/points/rasterize_points.py index ce224d1e..0500e750 100644 --- a/pytorch3d/renderer/points/rasterize_points.py +++ b/pytorch3d/renderer/points/rasterize_points.py @@ -4,9 +4,7 @@ from typing import List, Optional, Tuple, Union import numpy as np import torch - -# pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. -from pytorch3d import _C +from pytorch3d import _C # pyre-fixme[21]: Could not find name `_C` in `pytorch3d`. from pytorch3d.renderer.mesh.rasterize_meshes import pix_to_non_square_ndc