From 4126a4b2ef945aa6694d4bb6a01f14d75db97b52 Mon Sep 17 00:00:00 2001 From: Zhou Wang Date: Sat, 10 Dec 2016 15:33:45 +0100 Subject: [PATCH] minor changes --- CNTK.Cpp.props | 4 ++-- Source/CNTKv2LibraryDll/API/CNTKLibrary.h | 10 +++------- Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h | 2 +- bindings/csharp/CSEvalV2Library/ValueExtensions.cs | 12 ------------ 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/CNTK.Cpp.props b/CNTK.Cpp.props index 615545fc0ed3..a04db909aeb7 100644 --- a/CNTK.Cpp.props +++ b/CNTK.Cpp.props @@ -45,8 +45,8 @@ false true - - false + + false true diff --git a/Source/CNTKv2LibraryDll/API/CNTKLibrary.h b/Source/CNTKv2LibraryDll/API/CNTKLibrary.h index c5c6db25a93c..4d5082e24d74 100644 --- a/Source/CNTKv2LibraryDll/API/CNTKLibrary.h +++ b/Source/CNTKv2LibraryDll/API/CNTKLibrary.h @@ -1568,7 +1568,6 @@ namespace CNTK return prefix + std::to_wstring(Internal::NewUniqueId()); } - inline std::wstring GenerateUid(VariableKind varKind) { return GenerateUid(std::wstring(VariableKindName(varKind))); @@ -1821,9 +1820,9 @@ namespace CNTK #endif protected: - static const size_t s_serializationVersion = 1; - VariableFieldsPtr m_dataFields; + + static const size_t s_serializationVersion = 1; }; // TODO: Variable equality should be based on uids. @@ -2146,7 +2145,6 @@ namespace std { } }; - // TODO: Variable hash should be based on uid. template <> struct hash<::CNTK::Variable> { @@ -2271,8 +2269,7 @@ namespace CNTK virtual void Backward(const BackPropStatePtr& state, const std::unordered_map& rootGradientValues, std::unordered_map& backPropagatedGradientValuesForInputs) = 0; - - + /// /// Returns the name of the operation that this Function denotes /// @@ -2472,7 +2469,6 @@ namespace CNTK // Disallow copy and move construction and assignment Function(const Function&) = delete; Function(Function&&) = delete; Function& operator=(const Function&) = delete; Function& operator=(Function&&) = delete; - protected: /// /// Protected constructor for derived 'Function' types to specify the actual input and output variables for the (primitive) Function instance. diff --git a/Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h b/Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h index c4aeb736122e..c9ba15d29f2d 100644 --- a/Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h +++ b/Source/CNTKv2LibraryDll/API/CNTKLibraryInternals.h @@ -220,6 +220,7 @@ namespace CNTK // This is meant for debugging purposes only and is very likely to be deprecated in the future. CNTK_API void SaveAsLegacyModel(const FunctionPtr& rootFunction, const std::wstring& modelFile); + CNTK_API size_t NewUniqueId(); // Internal hooks for testing and higher-level bindings @@ -253,6 +254,5 @@ namespace CNTK CNTK_API bool AreEqual(const ::CNTK::NDArrayView& view1, const ::CNTK::NDArrayView& view2, double relativeTolerance = 0.0, double absoluteTolerance = 0.0); class VariableResolver; - } } \ No newline at end of file diff --git a/bindings/csharp/CSEvalV2Library/ValueExtensions.cs b/bindings/csharp/CSEvalV2Library/ValueExtensions.cs index 381769e45046..27210319f4ec 100644 --- a/bindings/csharp/CSEvalV2Library/ValueExtensions.cs +++ b/bindings/csharp/CSEvalV2Library/ValueExtensions.cs @@ -41,18 +41,6 @@ public static void CopyTo(this Value value, Variable variable, List> throw new ArgumentException("The variable and value does not have same shape."); } - //if (variableShape.Rank != valueShape.Rank - 2) - //{ - // throw new ArgumentException("The variable and value does not have same shape."); - //} - //for (uint i = 0; i < variableShape.Rank; i++) - //{ - // if (variableShape.GetDimensionSize(i) != valueShape.GetDimensionSize(i)) - // { - // throw new ArgumentException("The shape ranks of varaible and value does not match."); - // } - //} - // Todo: transform sparse to dense // Currently only for dense if ((value.GetStorageFormat() != StorageFormat.Dense))