From 53f02beedcd545206e87a998d5fc63226f85aca3 Mon Sep 17 00:00:00 2001 From: Lauren Yu <6631887+laurenyu@users.noreply.github.com> Date: Mon, 10 Jun 2019 10:28:55 -0700 Subject: [PATCH] fix: fix logger creation in Chainer integ test script --- tests/data/chainer_mnist/distributed_mnist.py | 6 +++--- tests/data/chainer_mnist/failure_script.py | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/data/chainer_mnist/distributed_mnist.py b/tests/data/chainer_mnist/distributed_mnist.py index 0fd4fe735c..e43b613725 100644 --- a/tests/data/chainer_mnist/distributed_mnist.py +++ b/tests/data/chainer_mnist/distributed_mnist.py @@ -1,4 +1,4 @@ -# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of @@ -26,7 +26,7 @@ import numpy as np import sagemaker_containers -logger = logging.getLogger('user_script') +logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -173,4 +173,4 @@ def _preprocess_mnist(raw, withlabel, ndim, scale, image_dtype, label_dtype, rgb def model_fn(model_dir): model = L.Classifier(MLP(1000, 10)) serializers.load_npz(os.path.join(model_dir, 'model.npz'), model) - return model.predictor \ No newline at end of file + return model.predictor diff --git a/tests/data/chainer_mnist/failure_script.py b/tests/data/chainer_mnist/failure_script.py index 9ea99b6660..b528919896 100644 --- a/tests/data/chainer_mnist/failure_script.py +++ b/tests/data/chainer_mnist/failure_script.py @@ -1,3 +1,16 @@ -if __name__=='__main__': +# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file 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. + +if __name__ == '__main__': """For use with integration tests expecting failures.""" raise Exception('This failure is expected.')