Skip to content

Commit 5afca5f

Browse files
amyreesefacebook-github-bot
authored andcommitted
apply import merging for fbcode (11 of 11)
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: lisroach Differential Revision: D36402260 fbshipit-source-id: 7cb52f09b740ccc580e61e6d1787d27381a8ce00
1 parent 825e8aa commit 5afca5f

24 files changed

+35
-35
lines changed

hubconf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
slow_r50,
1515
slow_r50_detection,
1616
slowfast_16x8_r101_50_50,
17+
slowfast_r101,
1718
slowfast_r50,
1819
slowfast_r50_detection,
19-
slowfast_r101,
2020
x3d_l,
2121
x3d_m,
2222
x3d_s,

pytorchvideo/data/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
from .epic_kitchen_recognition import EpicKitchenRecognition # noqa
1414
from .hmdb51 import Hmdb51 # noqa
1515
from .kinetics import Kinetics # noqa
16-
from .labeled_video_dataset import LabeledVideoDataset, labeled_video_dataset # noqa
16+
from .labeled_video_dataset import labeled_video_dataset, LabeledVideoDataset # noqa
1717
from .ssv2 import SSv2
1818
from .ucf101 import Ucf101 # noqa

pytorchvideo/data/epic_kitchen/epic_kitchen_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import torch
88
from pytorchvideo.data.dataset_manifest_utils import (
99
EncodedVideoInfo,
10+
get_seconds_from_hms_time,
1011
VideoClipInfo,
1112
VideoDataset,
1213
VideoDatasetType,
1314
VideoFrameInfo,
1415
VideoInfo,
15-
get_seconds_from_hms_time,
1616
)
1717
from pytorchvideo.data.frame_video import FrameVideo
1818
from pytorchvideo.data.utils import DataclassFieldCaster, load_dataclass_dict_from_csv

pytorchvideo/data/kinetics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import torch
66
from pytorchvideo.data.clip_sampling import ClipSampler
77

8-
from .labeled_video_dataset import LabeledVideoDataset, labeled_video_dataset
8+
from .labeled_video_dataset import labeled_video_dataset, LabeledVideoDataset
99

1010

1111
"""

pytorchvideo/data/ucf101.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import torch
66
from pytorchvideo.data.clip_sampling import ClipSampler
77

8-
from .labeled_video_dataset import LabeledVideoDataset, labeled_video_dataset
8+
from .labeled_video_dataset import labeled_video_dataset, LabeledVideoDataset
99

1010

1111
"""

pytorchvideo/layers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from .attention import Mlp, MultiScaleAttention, MultiScaleBlock
44
from .attention_torchscript import ScriptableMultiScaleBlock
55
from .drop_path import DropPath
6-
from .fusion import ConcatFusion, ReduceFusion, make_fusion_layer
6+
from .fusion import ConcatFusion, make_fusion_layer, ReduceFusion
77
from .mlp import make_multilayer_perceptron
88
from .positional_encoding import PositionalEncoding, SpatioTemporalClsPositionalEncoding
99
from .positional_encoding_torchscript import (

pytorchvideo/models/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
22

33
from .csn import create_csn
4-
from .head import ResNetBasicHead, create_res_basic_head
4+
from .head import create_res_basic_head, ResNetBasicHead
55
from .masked_multistream import (
6-
LSTM,
76
LearnMaskedDefault,
7+
LSTM,
88
MaskedMultiPathWay,
99
MaskedSequential,
1010
MaskedTemporalPooling,
@@ -14,6 +14,6 @@
1414
from .net import MultiPathWayWithFuse, Net
1515
from .resnet import BottleneckBlock, create_bottleneck_block, create_resnet
1616
from .slowfast import create_slowfast
17-
from .stem import ResNetBasicStem, create_conv_patch_embed, create_res_basic_stem
17+
from .stem import create_conv_patch_embed, create_res_basic_stem, ResNetBasicStem
1818
from .vision_transformers import create_multiscale_vision_transformers
1919
from .weight_init import init_net_weights

pytorchvideo/models/csn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import torch
66
import torch.nn as nn
77
from pytorchvideo.models.head import create_res_basic_head
8-
from pytorchvideo.models.resnet import Net, create_bottleneck_block, create_res_stage
8+
from pytorchvideo.models.resnet import create_bottleneck_block, create_res_stage, Net
99
from pytorchvideo.models.stem import create_res_basic_stem
1010

1111

pytorchvideo/models/hub/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from .resnet import c2d_r50, i3d_r50, slow_r50, slow_r50_detection
77
from .slowfast import (
88
slowfast_16x8_r101_50_50,
9+
slowfast_r101,
910
slowfast_r50,
1011
slowfast_r50_detection,
11-
slowfast_r101,
1212
)
1313
from .vision_transformers import mvit_base_16, mvit_base_16x4, mvit_base_32x3
1414
from .x3d import x3d_l, x3d_m, x3d_s, x3d_xs

pytorchvideo/models/hub/vision_transformers.py

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

10-
from .utils import MODEL_ZOO_ROOT_DIR, hub_model_builder
10+
from .utils import hub_model_builder, MODEL_ZOO_ROOT_DIR
1111

1212

1313
checkpoint_paths = {

0 commit comments

Comments
 (0)