Add pylint check for W0611 unused-import in ci_sanity.sh and fix existing pylint errors.
PiperOrigin-RevId: 184790548
This commit is contained in:
parent
2ec89055c1
commit
b9018073ec
@ -17,9 +17,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
from tensorflow.contrib.copy_graph.python.util import copy_elements
|
||||
from tensorflow.contrib.framework.python.framework import tensor_util
|
||||
from tensorflow.python.client import session as session_lib
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import ops
|
||||
|
@ -65,7 +65,6 @@ import six
|
||||
import tensorflow as tf
|
||||
|
||||
from tensorflow.contrib.eager.python import tfe
|
||||
from tensorflow.python.eager import context
|
||||
|
||||
try:
|
||||
import matplotlib.pyplot as plt # pylint: disable=g-import-not-at-top
|
||||
|
@ -27,16 +27,11 @@ import numpy as np
|
||||
from tensorflow.contrib.framework.python.ops import accumulate_n_v2 as av2
|
||||
|
||||
from tensorflow.python.eager import backprop
|
||||
from tensorflow.python.eager import context as eager_context
|
||||
from tensorflow.python.eager import tape
|
||||
|
||||
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes as dtypes_lib
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.framework import test_util
|
||||
from tensorflow.python.ops import gradients
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import resource_variable_ops
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -22,7 +22,6 @@ import numpy as np
|
||||
|
||||
from tensorflow.contrib.framework.python.ops import accumulate_n_v2 as av2
|
||||
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes as dtypes_lib
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.framework import test_util
|
||||
|
@ -32,9 +32,8 @@ from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import control_flow_ops
|
||||
from tensorflow.python.ops import variable_scope
|
||||
from tensorflow.python.ops import gen_state_ops
|
||||
from tensorflow.python.platform import tf_logging as logging
|
||||
from tensorflow.python.platform import resource_loader
|
||||
from tensorflow.python.platform import tf_logging as logging
|
||||
from tensorflow.python.training import saver as tf_saver
|
||||
from tensorflow.python.training import training_util
|
||||
from tensorflow.python.util.deprecation import deprecated
|
||||
|
@ -18,13 +18,8 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
from six.moves import xrange # pylint: disable=redefined-builtin
|
||||
|
||||
from tensorflow.contrib.image.python.ops.single_image_random_dot_stereograms \
|
||||
import single_image_random_dot_stereograms
|
||||
from tensorflow.python.client import session
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import test_util
|
||||
from tensorflow.python.platform import googletest
|
||||
|
@ -23,13 +23,11 @@ import csv
|
||||
import os
|
||||
from os import path
|
||||
import random
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
from six.moves import urllib
|
||||
|
||||
from tensorflow.contrib.framework import deprecated
|
||||
from tensorflow.python.platform import gfile
|
||||
|
||||
Dataset = collections.namedtuple('Dataset', ['data', 'target'])
|
||||
|
@ -20,7 +20,6 @@ from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.contrib.layers import conv2d
|
||||
from tensorflow.contrib.learn.python.learn import ops
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
|
@ -21,7 +21,6 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
import six
|
||||
|
||||
from tensorflow.contrib.framework.python.ops import add_arg_scope
|
||||
|
@ -18,7 +18,6 @@ from __future__ import print_function
|
||||
|
||||
import numbers
|
||||
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.framework import tensor_shape
|
||||
from tensorflow.python.framework import tensor_util
|
||||
@ -26,7 +25,6 @@ from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import random_ops
|
||||
from tensorflow.python.ops import gen_math_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import nn_impl
|
||||
|
||||
|
||||
def alpha_dropout(x, keep_prob, noise_shape=None, seed=None, name=None): # pylint: disable=invalid-name
|
||||
|
@ -21,7 +21,6 @@ from __future__ import print_function
|
||||
from tensorflow.contrib.nn.python.ops.alpha_dropout import alpha_dropout
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import random_ops
|
||||
from tensorflow.python.ops import nn_impl
|
||||
|
@ -21,12 +21,9 @@ from __future__ import print_function
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.contrib.opt.python.training import nadam_optimizer
|
||||
from tensorflow.python.client import session
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import resource_variable_ops
|
||||
from tensorflow.python.ops import variables
|
||||
from tensorflow.python.platform import test
|
||||
|
@ -18,13 +18,14 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
# pylint: disable=unused-import
|
||||
from tensorflow.contrib.periodic_resample.python.ops import gen_periodic_resample_op
|
||||
|
||||
from tensorflow.contrib.periodic_resample.python.ops.gen_periodic_resample_op import periodic_resample
|
||||
|
||||
from tensorflow.contrib.util import loader
|
||||
from tensorflow.python.platform import resource_loader
|
||||
# pylint: enable=unused-import
|
||||
|
||||
_periodic_resample_op = loader.load_op_library(
|
||||
resource_loader.get_path_to_datafile('_periodic_resample_op.so'))
|
||||
|
@ -19,7 +19,6 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
import unittest
|
||||
|
||||
from tensorflow.contrib.reduce_slice_ops.python.ops import reduce_slice_ops
|
||||
from tensorflow.python.framework.test_util import TensorFlowTestCase
|
||||
|
@ -39,8 +39,6 @@ from tensorflow.python.ops import rnn_cell_impl
|
||||
from tensorflow.python.ops import variable_scope
|
||||
from tensorflow.python.ops import variables as variables_lib
|
||||
from tensorflow.python.platform import test
|
||||
from tensorflow.python.framework import test_util
|
||||
from tensorflow.contrib.rnn.python.ops import rnn_cell as contrib_rnn_cell
|
||||
|
||||
# pylint: enable=protected-access
|
||||
Linear = core_rnn_cell._Linear # pylint: disable=invalid-name
|
||||
|
@ -32,12 +32,12 @@ from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import clip_ops
|
||||
from tensorflow.python.ops import init_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import nn_impl # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import nn_ops
|
||||
from tensorflow.python.ops import partitioned_variables # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import random_ops
|
||||
from tensorflow.python.ops import rnn_cell_impl
|
||||
from tensorflow.python.ops import variable_scope as vs
|
||||
from tensorflow.python.ops import partitioned_variables
|
||||
from tensorflow.python.ops import nn_impl
|
||||
from tensorflow.python.platform import tf_logging as logging
|
||||
from tensorflow.python.util import nest
|
||||
|
||||
|
@ -70,7 +70,6 @@ import heapq
|
||||
import math
|
||||
import os
|
||||
|
||||
from six.moves import xrange # pylint: disable=redefined-builtin
|
||||
from tensorflow.python.platform import gfile
|
||||
from tensorflow.python.util.deprecation import deprecated
|
||||
|
||||
|
@ -23,7 +23,6 @@ from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import nn
|
||||
from tensorflow.python.platform import resource_loader
|
||||
|
||||
__all__ = ["sparsemax"]
|
||||
|
||||
|
@ -18,8 +18,6 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.contrib.util import loader
|
||||
from tensorflow.python.platform import resource_loader
|
||||
from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
|
@ -18,7 +18,6 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import tensorflow as tf
|
||||
|
@ -18,6 +18,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
# pylint: disable=unused-import
|
||||
import gzip
|
||||
import os
|
||||
import tempfile
|
||||
@ -27,3 +28,4 @@ from six.moves import urllib
|
||||
from six.moves import xrange # pylint: disable=redefined-builtin
|
||||
import tensorflow as tf
|
||||
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
|
||||
# pylint: enable=unused-import
|
||||
|
@ -31,7 +31,6 @@ from tensorflow.core.framework import attr_value_pb2
|
||||
from tensorflow.core.framework import types_pb2
|
||||
from tensorflow.core.lib.core import error_codes_pb2
|
||||
from tensorflow.core.protobuf import config_pb2
|
||||
from tensorflow.core.protobuf import rewriter_config_pb2
|
||||
from tensorflow.python.client import session
|
||||
from tensorflow.python.framework import common_shapes
|
||||
from tensorflow.python.framework import constant_op
|
||||
@ -48,7 +47,6 @@ from tensorflow.python.ops import control_flow_ops
|
||||
from tensorflow.python.ops import data_flow_ops
|
||||
from tensorflow.python.ops import gen_control_flow_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import random_ops
|
||||
# Import resource_variable_ops for the variables-to-tensor implicit conversion.
|
||||
from tensorflow.python.ops import resource_variable_ops # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import state_ops
|
||||
|
@ -21,10 +21,10 @@ from __future__ import print_function
|
||||
import hashlib
|
||||
import imp
|
||||
import sys
|
||||
import threading
|
||||
import threading # pylint: disable=unused-import
|
||||
|
||||
from tensorflow.core.framework import op_def_pb2
|
||||
from tensorflow.core.lib.core import error_codes_pb2
|
||||
from tensorflow.core.lib.core import error_codes_pb2 # pylint: disable=unused-import
|
||||
from tensorflow.python import pywrap_tensorflow as py_tf
|
||||
from tensorflow.python.framework import errors_impl
|
||||
from tensorflow.python.util import compat
|
||||
|
@ -49,7 +49,7 @@ from tensorflow.python.client import device_lib
|
||||
from tensorflow.python.client import session
|
||||
from tensorflow.python.eager import backprop
|
||||
from tensorflow.python.eager import context
|
||||
from tensorflow.python.eager import tape
|
||||
from tensorflow.python.eager import tape # pylint: disable=unused-import
|
||||
from tensorflow.python.framework import device as pydev
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import errors
|
||||
|
@ -21,7 +21,6 @@ from __future__ import print_function
|
||||
import numpy as np
|
||||
from six.moves import xrange # pylint: disable=redefined-builtin
|
||||
|
||||
from tensorflow.python.client import device_lib
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.ops import array_ops
|
||||
|
@ -20,7 +20,6 @@ from __future__ import print_function
|
||||
|
||||
from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.framework import errors_impl
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import image_ops
|
||||
from tensorflow.python.platform import test
|
||||
|
@ -19,7 +19,6 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.ops import array_ops
|
||||
|
@ -19,7 +19,6 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import random
|
||||
import re
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
|
@ -19,7 +19,6 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import random
|
||||
import re
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
|
@ -18,8 +18,6 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
|
||||
from tensorflow.python.framework import constant_op
|
||||
|
@ -20,9 +20,9 @@ from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.python.framework import random_seed
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import array_ops # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import gen_candidate_sampling_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import math_ops # pylint: disable=unused-import
|
||||
from tensorflow.python.util.tf_export import tf_export
|
||||
|
||||
|
||||
|
@ -55,7 +55,6 @@ import collections
|
||||
import functools
|
||||
|
||||
import six
|
||||
from six.moves import xrange # pylint: disable=redefined-builtin
|
||||
|
||||
from tensorflow.core.framework import attr_value_pb2
|
||||
from tensorflow.core.protobuf import control_flow_pb2
|
||||
|
@ -35,7 +35,7 @@ from tensorflow.python.framework import tensor_shape
|
||||
from tensorflow.python.framework import tensor_util
|
||||
from tensorflow.python.ops import array_grad # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import check_ops
|
||||
from tensorflow.python.ops import check_ops # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import control_flow_grad # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import control_flow_ops
|
||||
from tensorflow.python.ops import control_flow_util
|
||||
|
@ -24,7 +24,7 @@ from tensorflow.python.framework import constant_op
|
||||
from tensorflow.python.framework import dtypes
|
||||
from tensorflow.python.ops import gradient_checker
|
||||
from tensorflow.python.ops import gradients_impl
|
||||
from tensorflow.python.ops import nn_grad
|
||||
from tensorflow.python.ops import nn_grad # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import nn_ops
|
||||
from tensorflow.python.platform import test
|
||||
|
||||
|
@ -27,7 +27,7 @@ from tensorflow.python.framework import ops
|
||||
from tensorflow.python.ops import array_ops
|
||||
from tensorflow.python.ops import candidate_sampling_ops
|
||||
from tensorflow.python.ops import embedding_ops
|
||||
from tensorflow.python.ops import gen_array_ops
|
||||
from tensorflow.python.ops import gen_array_ops # pylint: disable=unused-import
|
||||
from tensorflow.python.ops import gen_nn_ops
|
||||
from tensorflow.python.ops import math_ops
|
||||
from tensorflow.python.ops import nn_ops
|
||||
|
@ -38,7 +38,7 @@ from tensorflow.core.framework import types_pb2
|
||||
from tensorflow.python.client import session
|
||||
from tensorflow.python.debug.wrappers import local_cli_wrapper
|
||||
from tensorflow.python.framework import ops as ops_lib
|
||||
from tensorflow.python.platform import app
|
||||
from tensorflow.python.platform import app # pylint: disable=unused-import
|
||||
from tensorflow.python.saved_model import loader
|
||||
from tensorflow.python.tools import saved_model_utils
|
||||
|
||||
|
@ -19,7 +19,7 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
from tensorflow.python.training import gen_training_ops
|
||||
from tensorflow.python.training import gen_training_ops # pylint: disable=unused-import
|
||||
# go/tf-wildcard-import
|
||||
# pylint: disable=wildcard-import
|
||||
from tensorflow.python.training.gen_training_ops import *
|
||||
|
@ -185,7 +185,8 @@ do_pylint() {
|
||||
# C0330 bad-continuation
|
||||
# C0301 line-too-long
|
||||
# C0326 bad-whitespace
|
||||
grep -E '(\[E|\[W0311|\[W0312|\[C0330|\[C0301|\[C0326)' ${OUTPUT_FILE} > ${ERRORS_FILE}
|
||||
# W0611 unused-import
|
||||
grep -E '(\[E|\[W0311|\[W0312|\[C0330|\[C0301|\[C0326|\[W0611)' ${OUTPUT_FILE} > ${ERRORS_FILE}
|
||||
|
||||
N_ERRORS=0
|
||||
while read -r LINE; do
|
||||
|
Loading…
Reference in New Issue
Block a user