Skip to content

Commit b91522f

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Drop unused imports from caffe2/python
Summary: From ``` ./python/libcst/libcst codemod remove_unused_imports.RemoveUnusedImportsWithGlean --no-format caffe2/ ``` Test Plan: Standard sandcastle tests Differential Revision: D25727359 fbshipit-source-id: 1107492aa1fc2e4e69d659da40625f097af25f64
1 parent 42d2e31 commit b91522f

96 files changed

Lines changed: 37 additions & 155 deletions

File tree

Some content is hidden

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

caffe2/python/_import_c_extension.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@
55
import sys
66
from caffe2.python import extension_loader
77

8-
# NOTE: we have to import python protobuf here **before** we load cpp extension.
9-
# Otherwise it breaks under certain build conditions if cpp implementation of
10-
# protobuf is used. Presumably there's some registry in protobuf library and
11-
# python side has to initialize the dictionary first, before static
12-
# initialization in python extension does so. Otherwise, duplicated protobuf
13-
# descriptors will be created and it can lead to obscure errors like
14-
# "Parameter to MergeFrom() must be instance of same class:
15-
# expected caffe2.NetDef got caffe2.NetDef."
16-
import caffe2.proto
17-
188
# We will first try to load the gpu-enabled caffe2. If it fails, we will then
199
# attempt to load the cpu version. The cpu backend is the minimum required, so
2010
# if that still fails, we will exit loud.

caffe2/python/benchmarks/sparse_lengths_sum_nbit_benchmark.py

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

66
import hypothesis.strategies as st
77
import numpy as np
8-
from caffe2.python import core, dyndep, workspace
8+
from caffe2.python import core, workspace
99

1010

1111
def benchmark_sparse_lengths_sum(

caffe2/python/convert.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@
55

66

77

8-
from caffe2.proto import caffe2_pb2, torch_pb2
9-
10-
import caffe2.python._import_c_extension as C

caffe2/python/convert_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44

55

6-
from caffe2.python import convert, workspace
7-
from caffe2.proto import caffe2_pb2, torch_pb2
6+
from caffe2.python import workspace
87
import unittest
9-
import numpy as np
108

119
class TestOperator(unittest.TestCase):
1210
def setUp(self):

caffe2/python/core_gradients_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55

6-
from future.utils import bytes_to_native_str
76
from hypothesis import given, settings
87
import hypothesis.strategies as st
98
import unittest

caffe2/python/dataio_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from caffe2.python.dataio import (
77
CompositeReader,
88
CompositeReaderBuilder,
9-
Reader,
109
ReaderBuilder,
1110
ReaderWithDelay,
1211
ReaderWithLimit,
@@ -29,7 +28,6 @@
2928
import shutil
3029
import unittest
3130
import tempfile
32-
import time
3331

3432

3533
def make_source_dataset(ws, size=100, offset=0, name=None):

caffe2/python/ideep/conv_op_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
import unittest
7-
import sys
87
import hypothesis.strategies as st
98
from hypothesis import given, settings
109
import numpy as np

caffe2/python/ideep/convfusion_op_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import unittest
77
import hypothesis.strategies as st
8-
from hypothesis import given, settings
9-
import copy
8+
from hypothesis import given
109
import numpy as np
1110
import math
1211
from caffe2.proto import caffe2_pb2

caffe2/python/ideep/dropout_op_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from hypothesis import given
88
import hypothesis.strategies as st
99
import numpy as np
10-
11-
from caffe2.proto import caffe2_pb2
1210
from caffe2.python import core, workspace
1311
import caffe2.python.hypothesis_test_util as hu
1412
import caffe2.python.ideep_test_util as mu

caffe2/python/ideep/order_switch_op_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import caffe2.python.ideep_test_util as mu
1111

1212
from hypothesis import given, settings
13-
from caffe2.proto import caffe2_pb2
1413
from caffe2.python import core, workspace
1514

1615

0 commit comments

Comments
 (0)