Skip to content

Commit 34bbb3a

Browse files
thatchfacebook-github-bot
authored andcommitted
apply import merging for fbcode/vision/fair (2 of 2)
Summary: Applies new import merging and sorting from µsort v1.0. When merging imports, µsort will make a best-effort to move associated comments to match merged elements, but there are known limitations due to the diynamic nature of Python and developer tooling. These changes should not produce any dangerous runtime changes, but may require touch-ups to satisfy linters and other tooling. Note that µsort uses case-insensitive, lexicographical sorting, which results in a different ordering compared to isort. This provides a more consistent sorting order, matching the case-insensitive order used when sorting import statements by module name, and ensures that "frog", "FROG", and "Frog" always sort next to each other. For details on µsort's sorting and merging semantics, see the user guide: https://usort.readthedocs.io/en/stable/guide.html#sorting Reviewed By: bottler Differential Revision: D35553814 fbshipit-source-id: be49bdb6a4c25264ff8d4db3a601f18736d17be1
1 parent df08ea8 commit 34bbb3a

File tree

67 files changed

+119
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+119
-114
lines changed

docs/tutorials/utils/generate_cow_renders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
from pytorch3d.renderer import (
1313
BlendParams,
1414
FoVPerspectiveCameras,
15+
look_at_view_transform,
1516
MeshRasterizer,
1617
MeshRenderer,
1718
PointLights,
1819
RasterizationSettings,
1920
SoftPhongShader,
2021
SoftSilhouetteShader,
21-
look_at_view_transform,
2222
)
2323

2424

projects/nerf/nerf/eval_video_utils.py

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

1010
import torch
11-
from pytorch3d.renderer import PerspectiveCameras, look_at_view_transform
11+
from pytorch3d.renderer import look_at_view_transform, PerspectiveCameras
1212
from torch.utils.data.dataset import Dataset
1313

1414

projects/nerf/nerf/implicit_function.py

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

99
import torch
1010
from pytorch3d.common.linear_with_repeat import LinearWithRepeat
11-
from pytorch3d.renderer import HarmonicEmbedding, RayBundle, ray_bundle_to_ray_points
11+
from pytorch3d.renderer import HarmonicEmbedding, ray_bundle_to_ray_points, RayBundle
1212

1313

1414
def _xavier_init(linear):

pytorch3d/common/linear_with_repeat.py

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

1010
import torch
1111
import torch.nn.functional as F
12-
from torch.nn import Parameter, init
12+
from torch.nn import init, Parameter
1313

1414

1515
class LinearWithRepeat(torch.nn.Module):

pytorch3d/datasets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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-
from .r2n2 import R2N2, BlenderCamera, collate_batched_R2N2, render_cubified_voxels
7+
from .r2n2 import BlenderCamera, collate_batched_R2N2, R2N2, render_cubified_voxels
88
from .shapenet import ShapeNetCore
99
from .utils import collate_batched_meshes
1010

pytorch3d/datasets/r2n2/r2n2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from tabulate import tabulate
2020

2121
from .utils import (
22-
BlenderCamera,
2322
align_bbox,
23+
BlenderCamera,
2424
compute_extrinsic_matrix,
2525
read_binvox_coords,
2626
voxelize,

pytorch3d/implicitron/dataset/implicitron_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from pytorch3d.io import IO
4040
from pytorch3d.renderer.camera_utils import join_cameras_as_batch
4141
from pytorch3d.renderer.cameras import CamerasBase, PerspectiveCameras
42-
from pytorch3d.structures.pointclouds import Pointclouds, join_pointclouds_as_batch
42+
from pytorch3d.structures.pointclouds import join_pointclouds_as_batch, Pointclouds
4343

4444
from . import types
4545

pytorch3d/implicitron/dataset/visualize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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-
from typing import Optional, Tuple, cast
7+
from typing import cast, Optional, Tuple
88

99
import torch
1010
from pytorch3d.implicitron.tools.point_cloud_utils import get_rgbd_point_cloud

pytorch3d/implicitron/eval_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import copy
99
import dataclasses
1010
import os
11-
from typing import Optional, cast
11+
from typing import cast, Optional
1212

1313
import lpips
1414
import torch

pytorch3d/implicitron/models/implicit_function/neural_radiance_field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import torch
1212
from pytorch3d.common.linear_with_repeat import LinearWithRepeat
1313
from pytorch3d.implicitron.tools.config import registry
14-
from pytorch3d.renderer import RayBundle, ray_bundle_to_ray_points
14+
from pytorch3d.renderer import ray_bundle_to_ray_points, RayBundle
1515
from pytorch3d.renderer.cameras import CamerasBase
1616
from pytorch3d.renderer.implicit import HarmonicEmbedding
1717

0 commit comments

Comments
 (0)