From cae7f1ccc4c2e840167e0fa7a4a35d83911684f7 Mon Sep 17 00:00:00 2001 From: mozga-intel Date: Mon, 25 Oct 2021 16:10:37 +0200 Subject: [PATCH 1/2] Add full import to avoid undefined varaibles --- .../model_backwards_compat_inference.py | 4 +++- .../model_backwards_compat_train.py | 2 +- tests/python/unittest/test_numpy_default_dtype.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py index 6e772ce91f42..5c644f3dff4b 100644 --- a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py +++ b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py @@ -17,7 +17,9 @@ # specific language governing permissions and limitations # under the License. -from common import * +from python.mxnet import gluon +from python.mxnet.test_utils import assert_almost_equal +from tests.nightly.model_backwards_compatibility_check.common import * def test_lenet_gluon_load_params_api(): model_name = 'lenet_gluon_save_params_api' diff --git a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py index 5623c34240b3..86c83983f664 100644 --- a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py +++ b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -from common import * +from tests.nightly.model_backwards_compatibility_check.common import * def train_lenet_gluon_save_params_api(): diff --git a/tests/python/unittest/test_numpy_default_dtype.py b/tests/python/unittest/test_numpy_default_dtype.py index 4f9867a65b67..957f23e5f3d3 100644 --- a/tests/python/unittest/test_numpy_default_dtype.py +++ b/tests/python/unittest/test_numpy_default_dtype.py @@ -181,7 +181,7 @@ def check_default_dtype(op_list): assert False assert workloads is not None, 'Workloads for operator `{}` has not been ' \ 'added for checking default dtype with the ' \ - 'official NumPy and the deep NumPy.'.format(name) + 'official NumPy and the deep NumPy.'.format(op_name) for workload in workloads: check_np_default_dtype(op, *workload['args'], **workload['kwargs']) check_deepnp_default_dtype(op, *workload['args'], **workload['kwargs']) From 450fc21f005d41792b45449828e9fe614bf9e1f5 Mon Sep 17 00:00:00 2001 From: mozga-intel Date: Wed, 27 Oct 2021 08:41:25 +0200 Subject: [PATCH 2/2] Roll back full import --- .../__init__.py | 20 +++++++++++++++++++ .../model_backwards_compat_inference.py | 4 +--- .../model_backwards_compat_train.py | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 tests/nightly/model_backwards_compatibility_check/__init__.py diff --git a/tests/nightly/model_backwards_compatibility_check/__init__.py b/tests/nightly/model_backwards_compatibility_check/__init__.py new file mode 100644 index 000000000000..60e41c851ad9 --- /dev/null +++ b/tests/nightly/model_backwards_compatibility_check/__init__.py @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# coding: utf-8 + +from .common import * diff --git a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py index 5c644f3dff4b..c57c0f483e1b 100644 --- a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py +++ b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_inference.py @@ -17,9 +17,7 @@ # specific language governing permissions and limitations # under the License. -from python.mxnet import gluon -from python.mxnet.test_utils import assert_almost_equal -from tests.nightly.model_backwards_compatibility_check.common import * +from .common import * def test_lenet_gluon_load_params_api(): model_name = 'lenet_gluon_save_params_api' diff --git a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py index 86c83983f664..1a817611c4ce 100644 --- a/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py +++ b/tests/nightly/model_backwards_compatibility_check/model_backwards_compat_train.py @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -from tests.nightly.model_backwards_compatibility_check.common import * +from .common import * def train_lenet_gluon_save_params_api():