Skip to content

Commit ec5ff5d

Browse files
Merge pull request #48294 from bhack:pylint_silent
PiperOrigin-RevId: 376070925 Change-Id: I161036fd0826d1548d9eff9a39a131ece268a95f
2 parents 72e63b7 + 572c23f commit ec5ff5d

File tree

117 files changed

+490
-618
lines changed

Some content is hidden

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

117 files changed

+490
-618
lines changed

tensorflow/compiler/tests/binary_ops_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ def testBatchMatMul(self):
11201120
math_ops.matmul,
11211121
np.array([], dtype=dtype).reshape((0, 2, 4)),
11221122
np.array([], dtype=dtype).reshape((0, 4, 3)),
1123-
expected=np.array([], dtype=dtype).reshape(0, 2, 3))
1123+
expected=np.array([], dtype=dtype).reshape(0, 2, 3)) # pylint: disable=too-many-function-args
11241124

11251125
# Regression test for b/31472796.
11261126
if dtype != np.float16 and hasattr(np, "matmul"):

tensorflow/compiler/tests/image_ops_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ def testRGBToHSVNumpy(self):
9191
"""Tests the RGB to HSV conversion matches a reference implementation."""
9292
for nptype in self.float_types:
9393
rgb_flat = _generate_numpy_random_rgb((64, 3)).astype(nptype)
94-
rgb_np = rgb_flat.reshape(4, 4, 4, 3)
94+
rgb_np = rgb_flat.reshape(4, 4, 4, 3) # pylint: disable=too-many-function-args
9595
hsv_np = np.array([
9696
colorsys.rgb_to_hsv(
9797
r.astype(np.float64), g.astype(np.float64), b.astype(np.float64))
9898
for r, g, b in rgb_flat
9999
])
100-
hsv_np = hsv_np.reshape(4, 4, 4, 3)
100+
hsv_np = hsv_np.reshape(4, 4, 4, 3) # pylint: disable=too-many-function-args
101101
with self.session():
102102
placeholder = array_ops.placeholder(nptype)
103103
with self.test_scope():

tensorflow/lite/python/interpreter_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def testBaseProtectsFunctions(self):
402402
_ = self.interpreter.allocate_tensors()
403403
# Make sure we get an exception if we try to run an unsafe operation
404404
with self.assertRaisesRegex(RuntimeError, 'There is at least 1 reference'):
405-
_ = self.interpreter.invoke()
405+
_ = self.interpreter.invoke() # pylint: disable=assignment-from-no-return
406406
# Now test that we can run
407407
del in0 # this is our only buffer reference, so now it is safe to change
408408
in0safe = self.interpreter.tensor(self.input0)

tensorflow/python/autograph/converters/directives_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_loop_target(self):
6060
def f():
6161
a = True
6262
while True:
63-
directives.set_loop_options(parallel_iterations=10, back_prop=a)
63+
directives.set_loop_options(parallel_iterations=10, back_prop=a) # pylint: disable=unexpected-keyword-arg
6464
pass
6565

6666
_, node, _ = self.transform(f, directives_converter, include_ast=True)
@@ -86,7 +86,7 @@ def f():
8686
a = 1
8787
while True:
8888
a = 2
89-
directives.set_loop_options(parallel_iterations=10, back_prop=a)
89+
directives.set_loop_options(parallel_iterations=10, back_prop=a) # pylint: disable=unexpected-keyword-arg
9090

9191
with self.assertRaisesRegex(ValueError, 'must be the first statement'):
9292
self.transform(f, directives_converter, include_ast=True)

tensorflow/python/autograph/impl/api_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def test_converted_call_callable_metaclass(self):
489489

490490
class TestMetaclass(type):
491491

492-
def __call__(cls):
492+
def __call__(cls): # pylint: disable=method-hidden
493493
self.assertTrue(converter_testing.is_inside_generated_code())
494494
inst = object.__new__(cls)
495495
inst.__init__()

tensorflow/python/autograph/pyct/static_analysis/annos.py

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

2727
class NoValue(Enum):
2828

29-
def __repr__(self):
29+
def __repr__(self): # pylint: disable=invalid-repr-returned
3030
return self.name
3131

3232

tensorflow/python/client/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ def _do_call(self, fn, *args):
13911391
'\nby modifying the config for creating the session eg.'
13921392
'\nsession_config.graph_options.rewrite_options.'
13931393
'disable_meta_optimizer = True')
1394-
raise type(e)(node_def, op, message)
1394+
raise type(e)(node_def, op, message) # pylint: disable=no-value-for-parameter
13951395

13961396
def _extend_graph(self):
13971397
with self._graph._session_run_lock(): # pylint: disable=protected-access

tensorflow/python/compiler/tensorrt/test/base_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def ExpectedEnginesToBuild(self, run_params):
121121
}
122122

123123
def setUp(self):
124-
super(trt_test.TfTrtIntegrationTestBase, self).setUp()
124+
super(trt_test.TfTrtIntegrationTestBase, self).setUp() # pylint: disable=bad-super-call
125125
# Disable layout optimizer, since it will convert BiasAdd with NHWC
126126
# format to NCHW format under four dimentional input.
127127
self.DisableNonTrtOptimizers()

tensorflow/python/compiler/tensorrt/test/biasadd_matmul_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def GetParams(self):
107107
[[4, 6680]])
108108

109109
def setUp(self):
110-
super(trt_test.TfTrtIntegrationTestBase, self).setUp()
110+
super(trt_test.TfTrtIntegrationTestBase, self).setUp() # pylint: disable=bad-super-call
111111
# Disable layout optimizer, since it will convert BiasAdd with NHWC
112112
# format to NCHW format under four dimentional input.
113113
self.DisableNonTrtOptimizers()

tensorflow/python/compiler/tensorrt/test/binary_tensor_weight_broadcast_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def ExpectedEnginesToBuild(self, run_params):
6565
# TODO(b/176540862): remove this routine to disallow native segment execution
6666
# for TensorRT 7+.
6767
def setUp(self):
68-
super(trt_test.TfTrtIntegrationTestBase, self).setUp()
68+
super(trt_test.TfTrtIntegrationTestBase, self).setUp() # pylint: disable=bad-super-call
6969
if trt_test.IsTensorRTVersionGreaterEqual(7):
7070
os.environ["TF_TRT_ALLOW_ENGINE_NATIVE_SEGMENT_EXECUTION"] = "True"
7171

0 commit comments

Comments
 (0)