Remove unused imports from Python tests. (#5405)

This commit is contained in:
Sergii Dymchenko 2020-10-08 17:24:10 -07:00 committed by GitHub
parent 15696b8fce
commit 8a632a903f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 3 additions and 31 deletions

View file

@ -2,10 +2,8 @@
# Licensed under the MIT License.
import unittest
import pytest
from numpy.testing import assert_allclose, assert_array_equal
import torch
from onnxruntime_test_ort_trainer import runBertTrainingTest
class TestOrtTrainer(unittest.TestCase):

View file

@ -3,15 +3,10 @@
# -*- coding: UTF-8 -*-
import unittest
import os
import sys
import numpy as np
from numpy.testing import assert_allclose
import onnxruntime as onnxrt
from onnxruntime import datasets
import onnxruntime.backend as backend
from onnxruntime.backend.backend import OnnxRuntimeBackend as ort_backend
from onnx import load
from helper import get_name
class TestBackend(unittest.TestCase):

View file

@ -3,11 +3,7 @@
# -*- coding: UTF-8 -*-
import unittest
import os
import sys
import numpy as np
from numpy.testing import assert_allclose
import onnxruntime as onnxrt
from onnxruntime import datasets
import onnxruntime.backend as backend
from onnxruntime.backend.backend import OnnxRuntimeBackend as ort_backend

View file

@ -1,9 +1,7 @@
import numpy as np
import onnx
import onnxruntime
import unittest
from onnx import numpy_helper
from helper import get_name
class TestIOBinding(unittest.TestCase):

View file

@ -4,8 +4,6 @@
# -*- coding: UTF-8 -*-
# Taken from https://github.com/onnx/onnxmltools/blob/master/tests/end2end/test_custom_op.py.
import unittest
import os
import sys
import numpy as np
import onnxmltools
import onnxruntime as onnxrt

View file

@ -3,10 +3,8 @@
# -*- coding: UTF-8 -*-
import unittest
import os
import numpy as np
import onnxruntime as onnxrt
import threading
from helper import get_name

View file

@ -8,7 +8,6 @@ from onnx import helper, numpy_helper
import onnxruntime as onnxrt
import os
from onnxruntime.nuphar.rnn_benchmark import perf_test, generate_model
from pathlib import Path
import shutil
import sys
import subprocess
@ -532,7 +531,6 @@ class TestNuphar(unittest.TestCase):
assert np.allclose(first_lstm_data_output, scan_batch_data_output)
def test_gemm_to_matmul(self):
model_cnt = 0
gemm_model_name_prefix = "gemm_model"
matmul_model_name_prefix = "matmul_model"
common_config = {
@ -582,7 +580,6 @@ class TestNuphar(unittest.TestCase):
assert np.allclose(expected_y, actual_y)
def test_gemm_to_matmul_with_scan(self):
model_cnt = 0
gemm_model_name_prefix = "gemm_scan_model"
matmul_model_name_prefix = "matmul_scan_model"

View file

@ -6,7 +6,6 @@ import onnx
import os
from onnxruntime.tools.symbolic_shape_infer import SymbolicShapeInference
from pathlib import Path
import sys
import unittest
class TestSymbolicShapeInference(unittest.TestCase):

View file

@ -2,21 +2,15 @@
# Licensed under the MIT License.
import unittest
import pytest
import sys
import copy
from numpy.testing import assert_allclose, assert_array_equal
from numpy.testing import assert_allclose
import onnx
import torch
import torch.nn as nn
import torch.nn.functional as F
from onnxruntime_test_ort_trainer import map_optimizer_attributes, ort_trainer_learning_rate_description
from helper import get_name
import onnxruntime
from onnxruntime_test_training_unittest_utils import process_dropout
from onnxruntime.capi.ort_trainer import ORTTrainer, IODescription, ModelDescription, LossScaler, generate_sample
from onnxruntime.capi.ort_trainer import ORTTrainer, IODescription, ModelDescription
torch.manual_seed(1)
onnxruntime.set_seed(1)
@ -66,7 +60,7 @@ class TestTrainingDropout(unittest.TestCase):
eval_output = model.eval_step(input)
assert_allclose(expected_eval_output, eval_output.item(), rtol=rtol, err_msg="dropout eval loss mismatch")
# Do another train step to make sure it's using original ratios
train_output_2 = model.train_step(*input_args)
assert_allclose(expected_training_output, train_output_2.item(), rtol=rtol, err_msg="dropout training loss 2 mismatch")

View file

@ -1,4 +1,3 @@
import sys
import numpy as np
from onnx import numpy_helper