Skip to content

Commit

Permalink
Import regrouping.
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
  • Loading branch information
mzient committed Nov 4, 2024
1 parent 628e146 commit 0474225
Show file tree
Hide file tree
Showing 27 changed files with 27 additions and 59 deletions.
3 changes: 1 addition & 2 deletions dali/test/python/checkpointing/test_dali_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@
get_dali_extra_path,
module_functions,
)
from nose_utils import assert_warns, assert_raises
from nose_utils import assert_warns, assert_raises, attr
from nose2.tools import params, cartesian_params
from dataclasses import dataclass
from nvidia.dali import tfrecord as tfrec
from nvidia.dali.auto_aug import auto_augment as aa
from nvidia.dali.auto_aug import rand_augment as ra
from nvidia.dali.auto_aug import trivial_augment as ta
from reader.test_numpy import is_gds_supported
from nose_utils import attr


reader_signed_off = create_sign_off_decorator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
make_external_source_test_pipeline_factory,
images_dir,
)
from nose_utils import assert_raises
from nose_utils import assert_raises, SkipTest
import nvidia.dali.fn as fn
from nvidia.dali.pipeline import pipeline_def
from nose2.tools import params, cartesian_params
import numpy as np
from nvidia.dali.plugin.base_iterator import LastBatchPolicy
from nose_utils import SkipTest


class FwTestBase:
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/decoder/test_imgcodec.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
import random
from nvidia.dali import pipeline_def

from nose_utils import assert_raises
from nose_utils import assert_raises, SkipTest
from test_utils import compare_pipelines
from test_utils import get_dali_extra_path
from test_utils import to_array
from test_utils import get_arch
from test_utils import dump_as_core_artifacts
from nose2.tools import params
from nose_utils import SkipTest


def get_img_files(data_path, subdir="*", ext=None):
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/decoder/test_jpeg_scan_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
import unittest
from nvidia.dali import pipeline_def

from nose_utils import assert_raises
from nose_utils import attr
from nose_utils import assert_raises, attr
from nose2.tools import cartesian_params


Expand Down
4 changes: 1 addition & 3 deletions dali/test/python/decoder/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
from test_utils import get_dali_extra_path, is_mulit_gpu, skip_if_m60
from nvidia.dali.backend import TensorListGPU
from nose2.tools import params
from nose_utils import SkipTest
from nose_utils import attr
from nose_utils import assert_raises
from nose_utils import SkipTest, attr, assert_raises


filenames = glob.glob(f"{get_dali_extra_path()}/db/video/[cv]fr/*.mp4")
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_1/test_arithmetic_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
import nvidia.dali.math as math
from nvidia.dali.tensors import TensorListGPU
import numpy as np
from nose_utils import attr
from nose_utils import attr, aises, assert_raises, assert_equals

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'aises' is not used.
from nose2.tools import params
import itertools

from test_utils import np_type_to_dali
from nose_utils import raises, assert_raises, assert_equals


def list_product(*args):
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_1/test_crop_mirror_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
from nvidia.dali.pipeline import Pipeline

from nose2.tools import params
from nose_utils import assert_raises
from nose_utils import raises
from nose_utils import raises, assert_raises
from test_slice import check_slice_output, abs_slice_start_and_end
from test_utils import RandomDataIterator
from test_utils import as_array
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_1/test_gaussian_blur.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import cv2
from scipy.ndimage import convolve1d
import os
from nose_utils import assert_raises, raises
from nose_utils import attr
from nose_utils import assert_raises, raises, attr

from sequences_test_utils import video_suite_helper, ArgCb
from test_utils import (
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_1/test_laplacian.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import cv2
from scipy.ndimage import convolve1d, filters as sp_filters
import os
from nose_utils import assert_raises
from nose_utils import attr
from nose_utils import assert_raises, attr

from sequences_test_utils import video_suite_helper, ArgCb
from test_utils import get_dali_extra_path, check_batch, RandomlyShapedDataIterator
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_1/test_numba_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import nvidia.dali as dali
import nvidia.dali.fn as fn
import nvidia.dali.types as dali_types
from nose_utils import with_setup
from nose_utils import with_setup, attr
from test_utils import (
get_dali_extra_path,
to_array,
Expand All @@ -28,7 +28,6 @@
)
from nvidia.dali.plugin.numba.fn.experimental import numba_function
from numba import cuda
from nose_utils import attr

test_data_root = get_dali_extra_path()
lmdb_folder = os.path.join(test_data_root, "db", "lmdb")
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_2/test_random_object_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


# nose_utils goes first to deal with Python 3.10 incompatibility
from nose_utils import assert_raises
from nose_utils import attr, nottest, assert_raises
import nvidia.dali as dali
import nvidia.dali.fn as fn
import nvidia.dali.ops as ops
Expand All @@ -23,7 +23,6 @@
import scipy.ndimage.measurements
import random
from test_utils import check_batch, np_type_to_dali
from nose_utils import attr, nottest


np.random.seed(1234)
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/operator_2/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

import nvidia.dali.fn as fn
from nvidia.dali.pipeline import Pipeline
from nose_utils import nottest
from nose_utils import nottest, assert_raises

import numpy as np

from test_utils import np_type_to_dali
from nose_utils import assert_raises


class Batch:
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/reader/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
import tempfile
import numpy as np
from test_utils import compare_pipelines, get_dali_extra_path
from nose_utils import assert_raises, raises
from nose_utils import assert_raises, raises, SkipTest
from nose2.tools import cartesian_params
from nose_utils import SkipTest


def skip_second(src, dst):
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/reader/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import platform
import random
import tempfile
from nose_utils import assert_raises
from nose_utils import SkipTest
from nose_utils import assert_raises, SkipTest
from nose2.tools import params, cartesian_params
from test_utils import compare_pipelines, to_array

Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/reader/test_webdataset_corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
import os
import tempfile
from glob import glob
from nose_utils import assert_equals
from nose_utils import assert_equals, assert_raises

import webdataset_base as base
from nose_utils import assert_raises
from test_utils import compare_pipelines, get_dali_extra_path


Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/reader/test_webdataset_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import math
import nvidia.dali as dali
from test_utils import compare_pipelines, get_dali_extra_path
from nose_utils import assert_raises
from nose_utils import assert_equals
from nose_utils import assert_raises, assert_equals
from webdataset_base import (
generate_temp_extract,
generate_temp_index_file,
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_backend_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
from nvidia.dali.backend_impl import types as types_
import nvidia.dali as dali

from nose_utils import assert_raises
from nose_utils import SkipTest
from nose_utils import assert_raises, SkipTest
from test_utils import dali_type_to_np, py_buffer_from_address, get_device_memory_info


Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_dali_cpu_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
import os
import re
from collections.abc import Iterable
from nose_utils import attr, nottest
from nose_utils import attr, nottest, assert_raises
from nvidia.dali.pipeline import Pipeline, pipeline_def
from nvidia.dali.pipeline.experimental import pipeline_def as experimental_pipeline_def
from nvidia.dali.plugin.numba.fn.experimental import numba_function

from nose_utils import assert_raises
from segmentation_test_utils import make_batch_select_masks
from test_dali_cpu_only_utils import (
pipeline_arithm_ops_cpu,
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_dali_tf_dataset_eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import nvidia.dali.plugin.tf as dali_tf
from nvidia.dali.plugin.tf.experimental import Input
from nvidia.dali import fn
from nose_utils import with_setup
from nose_utils import with_setup, raises
from test_dali_tf_dataset_pipelines import (
FixedSampleIterator,
RandomSampleIterator,
Expand Down Expand Up @@ -46,7 +46,6 @@
skip_for_incompatible_tf,
skip_inputs_for_incompatible_tf,
)
from nose_utils import raises
import random as random
import itertools

Expand Down
4 changes: 1 addition & 3 deletions dali/test/python/test_dali_tf_dataset_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
import numpy as np
import random as random
import tensorflow as tf
from nose_utils import with_setup

from nose_utils import raises
from nose_utils import with_setup, raises
from test_dali_tf_dataset_pipelines import (
FixedSampleIterator,
external_source_tester,
Expand Down
4 changes: 1 addition & 3 deletions dali/test/python/test_dali_tf_dataset_mnist_eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
# limitations under the License.

import tensorflow as tf
from nose_utils import with_setup
from nose_utils import with_setup, raises, SkipTest

import test_dali_tf_dataset_mnist as mnist
from test_utils_tensorflow import skip_for_incompatible_tf, available_gpus
from nose_utils import raises
from nose_utils import SkipTest
from packaging.version import Version

tf.compat.v1.enable_eager_execution()
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_external_source_impl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from nvidia.dali._utils import external_source_impl
from nvidia.dali import tensors, pipeline_def
import nvidia.dali.fn as fn
from nose_utils import raises, assert_equals
from nose_utils import attr
from nose_utils import raises, assert_equals, attr
import numpy as np


Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_functional_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.types as types
import numpy as np
from nose_utils import assert_raises
from nose_utils import assert_raises, attr
import sys
import inspect
from nose_utils import attr
import nose


Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_optical_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from nvidia.dali.pipeline import pipeline_def
from nvidia.dali import fn, types
from test_utils import get_dali_extra_path, get_arch
from nose_utils import raises, assert_raises
from nose_utils import SkipTest
from nose_utils import raises, assert_raises, SkipTest

test_data_root = get_dali_extra_path()
images_dir = os.path.join(test_data_root, "db", "imgproc")
Expand Down
5 changes: 1 addition & 4 deletions dali/test/python/test_pipeline_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@

import numpy as np
import os
from nose_utils import attr

from nvidia.dali import fn
from nvidia.dali import tensors
from nvidia.dali import types
from nvidia.dali.pipeline.experimental import pipeline_def
from nose_utils import raises
from nose_utils import attr, raises, assert_raises
from test_utils import compare_pipelines, get_dali_extra_path
from nose_utils import assert_raises

from conditionals.test_pipeline_conditionals import (
pred_gens,
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_pipeline_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@

import numpy as np
import nvidia.dali.fn as fn
from nose_utils import attr
from nose_utils import attr, raises
from nose2.tools import params
from numpy.random import default_rng
from nvidia.dali import pipeline_def
from nvidia.dali.tensors import TensorCPU, TensorGPU

from nose_utils import raises
from test_utils import to_array

max_batch_size = 256
Expand Down
3 changes: 1 addition & 2 deletions dali/test/python/test_torch_pipeline_rnnt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import nose_utils # noqa:F401 - for Python 3.10
from nose_utils import nottest
import nvidia.dali.fn as fn
from nvidia.dali import pipeline_def
import nvidia.dali.types as types
Expand All @@ -23,7 +23,6 @@
import math
import random
import os
from nose_utils import nottest

# Filtering librispeech samples
audio_files = get_files("db/audio/wav", "wav")
Expand Down

0 comments on commit 0474225

Please sign in to comment.