From 83866ebddc9e43f3974abcd12ed6aa6a21b1314f Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Thu, 3 Oct 2019 00:31:47 +0000 Subject: [PATCH 1/3] [NFC] [AutoDiff] Minor cleanup. - Set default true for `-enable-experimental-differentiable-programming` flag on tensorflow branch. The default will be false on master. - Rename unit test to AutoDiffIndexSubset.cpp, since `AutoDiffIndexSubset` is the tested data structure. --- include/swift/Basic/LangOptions.h | 2 +- .../AST/{SILAutoDiffIndices.cpp => AutoDiffIndexSubset.cpp} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename unittests/AST/{SILAutoDiffIndices.cpp => AutoDiffIndexSubset.cpp} (100%) diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index 27a075a669f77..d894807365f89 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -329,7 +329,7 @@ namespace swift { /// Whether to enable experimental differentiable programming features: /// `@differentiable` declaration attribute, etc. - bool EnableExperimentalDifferentiableProgramming = false; + bool EnableExperimentalDifferentiableProgramming = true; /// Whether to enable #quote, #unquote and @quoted. bool EnableExperimentalQuasiquotes = false; diff --git a/unittests/AST/SILAutoDiffIndices.cpp b/unittests/AST/AutoDiffIndexSubset.cpp similarity index 100% rename from unittests/AST/SILAutoDiffIndices.cpp rename to unittests/AST/AutoDiffIndexSubset.cpp From a314d64a301e4efd5d69a4b0404f86dad0470d6b Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Thu, 3 Oct 2019 00:46:27 +0000 Subject: [PATCH 2/3] Address review feedback. --- include/swift/Basic/LangOptions.h | 2 ++ unittests/AST/AutoDiffIndexSubset.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index d894807365f89..40af1bdd96c63 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -329,6 +329,8 @@ namespace swift { /// Whether to enable experimental differentiable programming features: /// `@differentiable` declaration attribute, etc. + // SWIFT_ENABLE_TENSORFLOW + // The default on tensorflow branch is true. On master, it is false. bool EnableExperimentalDifferentiableProgramming = true; /// Whether to enable #quote, #unquote and @quoted. diff --git a/unittests/AST/AutoDiffIndexSubset.cpp b/unittests/AST/AutoDiffIndexSubset.cpp index 0dbaa63ec75d2..0c128a2dfca7d 100644 --- a/unittests/AST/AutoDiffIndexSubset.cpp +++ b/unittests/AST/AutoDiffIndexSubset.cpp @@ -1,4 +1,4 @@ -//===--- SILAutoDiffIndices.cpp - Tests SILAutoDiffIndices ----------------===// +//===--- AutoDiffIndexSubset.cpp - Tests AutoDiffIndexSubset --------------===// // // This source file is part of the Swift.org open source project // From d43ddf5bd1fb2bf5f6fdcc61bf129f07665c3057 Mon Sep 17 00:00:00 2001 From: Dan Zheng Date: Thu, 3 Oct 2019 01:28:50 +0000 Subject: [PATCH 3/3] Update unittests/AST/CMakeLists.txt. --- unittests/AST/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/AST/CMakeLists.txt b/unittests/AST/CMakeLists.txt index f4a4549cd3a1e..dff55c3fe1828 100644 --- a/unittests/AST/CMakeLists.txt +++ b/unittests/AST/CMakeLists.txt @@ -1,8 +1,8 @@ add_swift_unittest(SwiftASTTests ArithmeticEvaluator.cpp - DiagnosticConsumerTests.cpp # SWIFT_ENABLE_TENSORFLOW - SILAutoDiffIndices.cpp + AutoDiffIndexSubset.cpp + DiagnosticConsumerTests.cpp SourceLocTests.cpp TestContext.cpp TypeMatchTests.cpp