From 927750c549bce47645aa7d51ff8daf3aafba310f Mon Sep 17 00:00:00 2001 From: jeanfad Date: Thu, 11 Aug 2016 10:35:10 +0200 Subject: [PATCH] address cr comments --- contrib/PythonV2/cntk/setup.py | 2 +- .../PythonV2/cntk/{wrap => swig}/__init__.py | 0 contrib/PythonV2/cntk/{wrap => swig}/cntk_py.i | 0 .../PythonV2/cntk/{ => swig}/cntk_py_tester.py | 2 +- .../cntk/{wrap => swig}/cntk_py_wrap.cxx | 0 .../PythonV2/cntk/{wrap => swig}/cntk_py_wrap.h | 0 contrib/PythonV2/cntk/{wrap => swig}/numpy.i | 0 contrib/PythonV2/cntk/{wrap => swig}/readme.txt | 0 contrib/PythonV2/cntk/{wrap => swig}/swig.bat | 0 .../cntk/{wrap => swig}/swig_callback_run.py | 0 .../cntk/{wrap => swig}/test_wrapper.py | 8 +++++--- contrib/PythonV2/setup.py | 17 ----------------- contrib/PythonV2/setup_sh.ps | 1 - 13 files changed, 7 insertions(+), 23 deletions(-) rename contrib/PythonV2/cntk/{wrap => swig}/__init__.py (100%) rename contrib/PythonV2/cntk/{wrap => swig}/cntk_py.i (100%) rename contrib/PythonV2/cntk/{ => swig}/cntk_py_tester.py (97%) rename contrib/PythonV2/cntk/{wrap => swig}/cntk_py_wrap.cxx (100%) rename contrib/PythonV2/cntk/{wrap => swig}/cntk_py_wrap.h (100%) rename contrib/PythonV2/cntk/{wrap => swig}/numpy.i (100%) rename contrib/PythonV2/cntk/{wrap => swig}/readme.txt (100%) rename contrib/PythonV2/cntk/{wrap => swig}/swig.bat (100%) rename contrib/PythonV2/cntk/{wrap => swig}/swig_callback_run.py (100%) rename contrib/PythonV2/cntk/{wrap => swig}/test_wrapper.py (92%) delete mode 100644 contrib/PythonV2/setup.py delete mode 100644 contrib/PythonV2/setup_sh.ps diff --git a/contrib/PythonV2/cntk/setup.py b/contrib/PythonV2/cntk/setup.py index 5af5f0269..4d90696c5 100644 --- a/contrib/PythonV2/cntk/setup.py +++ b/contrib/PythonV2/cntk/setup.py @@ -14,7 +14,7 @@ ext_modules = [ Extension( name="_cntk_py", - sources=[os.path.join("wrap", "cntk_py_wrap.cxx")], + sources=[os.path.join("swig", "cntk_py_wrap.cxx")], libraries=[ os.path.join(CNTK_LIB_PATH, "CNTKLibrary-2.0"), diff --git a/contrib/PythonV2/cntk/wrap/__init__.py b/contrib/PythonV2/cntk/swig/__init__.py similarity index 100% rename from contrib/PythonV2/cntk/wrap/__init__.py rename to contrib/PythonV2/cntk/swig/__init__.py diff --git a/contrib/PythonV2/cntk/wrap/cntk_py.i b/contrib/PythonV2/cntk/swig/cntk_py.i similarity index 100% rename from contrib/PythonV2/cntk/wrap/cntk_py.i rename to contrib/PythonV2/cntk/swig/cntk_py.i diff --git a/contrib/PythonV2/cntk/cntk_py_tester.py b/contrib/PythonV2/cntk/swig/cntk_py_tester.py similarity index 97% rename from contrib/PythonV2/cntk/cntk_py_tester.py rename to contrib/PythonV2/cntk/swig/cntk_py_tester.py index c53b10067..ba31798b1 100644 --- a/contrib/PythonV2/cntk/cntk_py_tester.py +++ b/contrib/PythonV2/cntk/swig/cntk_py_tester.py @@ -1,7 +1,7 @@ import numpy as np import sys import os -sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) import cntk.cntk_py as cntk_py # class MyVariable(cntk_py.Variable): diff --git a/contrib/PythonV2/cntk/wrap/cntk_py_wrap.cxx b/contrib/PythonV2/cntk/swig/cntk_py_wrap.cxx similarity index 100% rename from contrib/PythonV2/cntk/wrap/cntk_py_wrap.cxx rename to contrib/PythonV2/cntk/swig/cntk_py_wrap.cxx diff --git a/contrib/PythonV2/cntk/wrap/cntk_py_wrap.h b/contrib/PythonV2/cntk/swig/cntk_py_wrap.h similarity index 100% rename from contrib/PythonV2/cntk/wrap/cntk_py_wrap.h rename to contrib/PythonV2/cntk/swig/cntk_py_wrap.h diff --git a/contrib/PythonV2/cntk/wrap/numpy.i b/contrib/PythonV2/cntk/swig/numpy.i similarity index 100% rename from contrib/PythonV2/cntk/wrap/numpy.i rename to contrib/PythonV2/cntk/swig/numpy.i diff --git a/contrib/PythonV2/cntk/wrap/readme.txt b/contrib/PythonV2/cntk/swig/readme.txt similarity index 100% rename from contrib/PythonV2/cntk/wrap/readme.txt rename to contrib/PythonV2/cntk/swig/readme.txt diff --git a/contrib/PythonV2/cntk/wrap/swig.bat b/contrib/PythonV2/cntk/swig/swig.bat similarity index 100% rename from contrib/PythonV2/cntk/wrap/swig.bat rename to contrib/PythonV2/cntk/swig/swig.bat diff --git a/contrib/PythonV2/cntk/wrap/swig_callback_run.py b/contrib/PythonV2/cntk/swig/swig_callback_run.py similarity index 100% rename from contrib/PythonV2/cntk/wrap/swig_callback_run.py rename to contrib/PythonV2/cntk/swig/swig_callback_run.py diff --git a/contrib/PythonV2/cntk/wrap/test_wrapper.py b/contrib/PythonV2/cntk/swig/test_wrapper.py similarity index 92% rename from contrib/PythonV2/cntk/wrap/test_wrapper.py rename to contrib/PythonV2/cntk/swig/test_wrapper.py index 05547266a..7d1a047db 100644 --- a/contrib/PythonV2/cntk/wrap/test_wrapper.py +++ b/contrib/PythonV2/cntk/swig/test_wrapper.py @@ -1,10 +1,12 @@ import pytest - +import sys import numpy as np -from cntk import cntk_py +import os +sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..')) +import cntk.cntk_py as cntk_py from cntk.ops import variable, constant from cntk.tests.test_utils import * -from ..utils import sanitize_batch, remove_masked_elements, pad_to_dense, precision_numpy, cntk_device +from cntk.utils import sanitize_batch, remove_masked_elements, pad_to_dense, precision_numpy, cntk_device def create_Value_with_value(shape, data_type, value, dev): if data_type == cntk_py.DataType_Float: diff --git a/contrib/PythonV2/setup.py b/contrib/PythonV2/setup.py deleted file mode 100644 index 1db5535ec..000000000 --- a/contrib/PythonV2/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) Microsoft. All rights reserved. - -# Licensed under the MIT license. See LICENSE.md file in the project root -# for full license information. -# ============================================================================== - -from distutils.core import setup - -setup(name='CNTK', - version='1.5', - description='CNTK', - author='Microsoft', - author_email='deepblis@microsoft.com', - url='cntk.ai', - packages=['cntk', 'cntk.examples', 'cntk.tests', 'cntk.utils', 'cntk.ops'], - package_data={'cntk': ['templates/*.cntk']} - ) diff --git a/contrib/PythonV2/setup_sh.ps b/contrib/PythonV2/setup_sh.ps deleted file mode 100644 index a44c52840..000000000 --- a/contrib/PythonV2/setup_sh.ps +++ /dev/null @@ -1 +0,0 @@ -$Env:CNTK_EXECUTABLE_PATH = 'c:\blis\cntk-bin\cntk\cntk.exe'