Skip to content

[CodeStyle][F401] remove unused import in unittests/test_[k-o] #46704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

import numpy as np
import paddle
from paddle import fluid, nn
from paddle import fluid
import paddle.fluid.dygraph as dg
import paddle.nn.functional as F
import paddle.fluid.initializer as I
import unittest


Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_lamb_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import numpy as np
from op_test import OpTest
import paddle
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.fluid.op import Operator

Expand Down
2 changes: 0 additions & 2 deletions python/paddle/fluid/tests/unittests/test_lambv2_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

import unittest
import numpy as np
from op_test import OpTest
from paddle.fluid import core
from paddle.fluid.op import Operator
from paddle.fluid.dygraph.base import switch_to_static_graph
import paddle
import paddle.fluid as fluid
Expand Down
7 changes: 0 additions & 7 deletions python/paddle/fluid/tests/unittests/test_launch_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import subprocess
import os
import time
import six
import copy
import unittest
import paddle.fluid as fluid

from argparse import ArgumentParser, REMAINDER
from paddle.distributed.utils.launch_utils import _print_arguments, get_gpus, get_cluster_from_args
Expand Down
5 changes: 1 addition & 4 deletions python/paddle/fluid/tests/unittests/test_layer_norm_op_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
from op_test import OpTest, _set_use_system_allocator
from paddle.fluid.framework import grad_var_name, _test_eager_guard
from paddle.fluid.framework import _test_eager_guard
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
import paddle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import tempfile
import unittest
import warnings
import numpy

import paddle
import paddle.nn.functional as F
Expand Down
2 changes: 0 additions & 2 deletions python/paddle/fluid/tests/unittests/test_lcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid import Program, program_guard
from op_test import OpTest

paddle.enable_static()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import numpy as np
import unittest

import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.framework as framework
Expand Down
4 changes: 0 additions & 4 deletions python/paddle/fluid/tests/unittests/test_linalg_pinv_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.core as core
from op_test import OpTest, skip_check_grad_ci
from gradient_checker import grad_check
from decorator_helper import prog_scope


class LinalgPinvTestCase(unittest.TestCase):
Expand Down
5 changes: 1 addition & 4 deletions python/paddle/fluid/tests/unittests/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
import unittest
import numpy as np
import paddle.fluid.core as core
from op_test import OpTest
import paddle
from paddle import fluid, nn
import paddle.fluid.dygraph as dg
from paddle import fluid
import paddle.nn.functional as F
import paddle.fluid.initializer as I


class LinearTestCase(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_linspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from op_test import OpTest
import paddle
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid import Program, program_guard
from paddle.fluid import core
from paddle.fluid.framework import _test_eager_guard

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@

import paddle
import paddle.fluid as fluid
import signal
import subprocess
import time
import unittest
from multiprocessing import Process
from op_test import OpTest

paddle.enable_static()

Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_load_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import unittest
import numpy as np
from op_test import OpTest, randomize_probability
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import os
Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_load_op_xpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import numpy as np
import os
import tempfile
from op_test import OpTest, randomize_probability
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import unittest
import os
import shutil
import numpy as np
import paddle as paddle
import paddle.fluid as fluid
from paddle.fluid.executor import Executor

Expand Down
6 changes: 1 addition & 5 deletions python/paddle/fluid/tests/unittests/test_lod_append_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
import unittest
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.core as core
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid.op import Operator
from paddle.fluid.backward import append_backward
from paddle.fluid import Program


class TestLoDAppendAPI(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from paddle.fluid.executor import Executor
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid import Program, program_guard
import numpy


Expand Down
2 changes: 0 additions & 2 deletions python/paddle/fluid/tests/unittests/test_logcumsumexp_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid.framework import _test_eager_guard
from op_test import OpTest


Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_logical_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import op_test
import unittest
import numpy as np
import paddle
Expand Down
5 changes: 1 addition & 4 deletions python/paddle/fluid/tests/unittests/test_lookahead.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@

import unittest
import numpy as np
from op_test import OpTest
from paddle.fluid import core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
import paddle
import paddle.nn as nn
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph
from paddle.fluid.framework import _test_eager_guard

LOOKAHEAD_K = 5
LOOKAHEAD_ALPHA = 0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@

import unittest
import numpy as np
from op_test import OpTest, skip_check_grad_ci
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.compat as cpt
import paddle.fluid as fluid
from paddle.fluid import Program, program_guard
from op_test import OpTest
import struct


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
import unittest
import numpy as np
import paddle
from paddle.fluid.tests.unittests.op_test import (skip_check_grad_ci,
convert_uint16_to_float)
from paddle.fluid.tests.unittests.op_test import convert_uint16_to_float
from paddle.fluid.tests.unittests.test_lookup_table_bf16_op import (
_lookup, TestLookupTableBF16Op, TestLookupTableBF16OpIds4D,
TestLookupTableBF16OpWIsSelectedRows,
Expand Down
3 changes: 0 additions & 3 deletions python/paddle/fluid/tests/unittests/test_lr_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import copy
import math
import numpy as np
import unittest

import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.framework as framework
import paddle.fluid.core as core


Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_lrn_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import paddle.fluid as fluid
import paddle.fluid.core as core
from op_test import OpTest
from paddle.fluid import compiler, Program, program_guard
from paddle.fluid import Program, program_guard


class TestLRNOp(OpTest):
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_lstm_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import unittest
import numpy as np
from op_test import OpTest, skip_check_grad_ci
from op_test import OpTest
from paddle import fluid
from paddle.fluid.layers import lstm as LSTM
from paddle.fluid.layers import fill_constant
Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_lu_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.core as core
import scipy
import scipy.linalg
Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_lu_unpack_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.layers as layers
import paddle.fluid.core as core
import scipy
import scipy.linalg
Expand Down
2 changes: 0 additions & 2 deletions python/paddle/fluid/tests/unittests/test_manual_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import paddle
import paddle.fluid as fluid
from paddle.framework import seed
from paddle.fluid.framework import Program, default_main_program, default_startup_program
import numpy as np


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import unittest
import numpy as np
from op_test import OpTest
import math
import random
import paddle
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.fluid import Program, program_guard

Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_marker_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import unittest
import numpy as np
from op_test import OpTest
from paddle.distributed.fleet.meta_optimizers.common import OpRole

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid as fluid
import paddle


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import paddle.fluid as fluid
import numpy as np
import inspect
from paddle.fluid.framework import _test_eager_guard, _in_legacy_dygraph
from paddle.fluid.framework import _test_eager_guard


class TestMathOpPatchesVarBase(unittest.TestCase):
Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_matmul_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import paddle.fluid.core as core
import unittest
import numpy as np
from op_test import OpTest
Expand Down
1 change: 0 additions & 1 deletion python/paddle/fluid/tests/unittests/test_matmul_v2_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import paddle
import paddle.fluid as fluid
import paddle.fluid.framework as framework
from paddle.fluid.framework import _test_eager_guard


Expand Down
4 changes: 0 additions & 4 deletions python/paddle/fluid/tests/unittests/test_matrix_power_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,8 @@ def check_static_result(self, place):
fetch_list=[result])
except RuntimeError as ex:
print("The mat is singular")
pass
except ValueError as ex:
print("The mat is singular")
pass

def test_static(self):
paddle.enable_static()
Expand All @@ -379,10 +377,8 @@ def test_dygraph(self):
result = paddle.linalg.matrix_power(input, -2)
except RuntimeError as ex:
print("The mat is singular")
pass
except ValueError as ex:
print("The mat is singular")
pass


if __name__ == "__main__":
Expand Down
5 changes: 1 addition & 4 deletions python/paddle/fluid/tests/unittests/test_matrix_rank_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@

import numpy as np

from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
from paddle.fluid.tests.unittests.op_test import OpTest
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid import compiler, Program, program_guard

paddle.enable_static()
SEED = 2049
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import paddle
import paddle.fluid as fluid
import paddle.fluid.core as core
from paddle.fluid import Program, program_guard
from op_test import OpTest

paddle.enable_static()

Expand Down
Loading