Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
52f30fa
Removed some instances of '#tfop'.
eaplatanios May 2, 2019
3218e17
Merged upstream changes.
eaplatanios May 2, 2019
19b9696
Moved the 'TensorFlow' to 'swift-apis'.
eaplatanios May 2, 2019
8db724d
Merged upstream changes.
eaplatanios May 3, 2019
db187e8
Minor edit.
eaplatanios May 11, 2019
9dece0b
Merged upstream changes.
eaplatanios May 11, 2019
ecec714
Merged upstream changes.
eaplatanios May 12, 2019
a9bcf7b
Added back the Swift bindings fetching to the CMakeLists file for Ten…
eaplatanios May 17, 2019
101a466
Merged upstream changes.
eaplatanios May 17, 2019
ce17dbc
Merged upstream changes.
eaplatanios May 22, 2019
651b41a
Fixed a couple of tests.
eaplatanios May 22, 2019
7eb1225
Merged upstream changes.
eaplatanios May 26, 2019
eb101ef
Bug fix.
eaplatanios May 28, 2019
b3f62cd
Removed the TF bindings from the CMakeLists file.
eaplatanios May 28, 2019
f7843dd
Tweak.
eaplatanios May 28, 2019
4fe9098
Removed references to swift-bindings.
eaplatanios May 30, 2019
316fea0
Merged upstream changes.
eaplatanios May 30, 2019
3e83858
Update update-checkout-config.json
rxwei May 30, 2019
32dfd82
Update raw_ops.swift
rxwei May 30, 2019
dcd03c5
Update lit.site.cfg.in
rxwei May 30, 2019
245c3d7
Update build-script-impl
rxwei May 30, 2019
43f002c
Fixed failing tests.
eaplatanios May 30, 2019
fca6d62
Minor edit to the gitignore file.
eaplatanios May 30, 2019
0cd043b
Removed the TensorGroup hack.
eaplatanios May 30, 2019
b880327
Merge remote-tracking branch 'upstream/tensorflow' into tensor-group-…
eaplatanios May 30, 2019
5babb55
Minor tweaks.
eaplatanios May 30, 2019
4a3c0a0
Updated the swift-apis dependency.
eaplatanios May 30, 2019
5a6c347
Fixed a test.
eaplatanios May 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/swift/AST/KnownIdentifiers.def
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ IDENTIFIER(withArguments)
IDENTIFIER(withKeywordArguments)

// SWIFT_ENABLE_TENSORFLOW
IDENTIFIER(TensorFlow)
// KeyPathIterable
IDENTIFIER(AllKeyPaths)
IDENTIFIER(allKeyPaths)
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/KnownProtocols.def
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ PROTOCOL(FloatingPoint)
PROTOCOL(KeyPathIterable)
PROTOCOL(TensorArrayProtocol)
PROTOCOL(TensorGroup)
PROTOCOL_(TensorFlowDataTypeCompatible)
PROTOCOL(TensorProtocol)
PROTOCOL(VectorNumeric)
PROTOCOL(Differentiable)

Expand Down
59 changes: 53 additions & 6 deletions lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,19 +809,62 @@ CanType ASTContext::getAnyObjectType() const {

// SWIFT_ENABLE_TENSORFLOW

/// Retrieve the decl for TensorDataType.
/// Retrieve the decl for TensorFlow.TensorHandle iff the TensorFlow module has
/// been imported. Otherwise, this returns null.
ClassDecl *ASTContext::getTensorHandleDecl() const {
if (getImpl().TensorHandleDecl)
return getImpl().TensorHandleDecl;

// See if the TensorFlow module was imported. If not, return null.
auto tfModule = getLoadedModule(Id_TensorFlow);
if (!tfModule)
return nullptr;

SmallVector<ValueDecl *, 1> results;
tfModule->lookupValue({ }, getIdentifier("TensorHandle"),
NLKind::UnqualifiedLookup, results);

for (auto result : results)
if (auto CD = dyn_cast<ClassDecl>(result))
return getImpl().TensorHandleDecl = CD;
return nullptr;
}

/// Retrieve the decl for TensorFlow.TensorShape iff the TensorFlow module has
/// been imported. Otherwise, this returns null.
StructDecl *ASTContext::getTensorShapeDecl() const {
if (getImpl().TensorShapeDecl)
return getImpl().TensorShapeDecl;

// See if the TensorFlow module was imported. If not, return null.
auto tfModule = getLoadedModule(Id_TensorFlow);
if (!tfModule)
return nullptr;

SmallVector<ValueDecl *, 1> results;
tfModule->lookupValue({}, getIdentifier("TensorShape"),
NLKind::UnqualifiedLookup, results);

for (auto result : results)
if (auto CD = dyn_cast<StructDecl>(result))
return getImpl().TensorShapeDecl = CD;
return nullptr;
}

/// Retrieve the decl for TensorFlow.TensorDataType iff the TensorFlow module has
/// been imported. Otherwise, this returns null.
StructDecl *ASTContext::getTensorDataTypeDecl() const {
if (getImpl().TensorDataTypeDecl)
return getImpl().TensorDataTypeDecl;

// See if the Stdlib module was imported. If not, return null.
auto stdlibModule = getStdlibModule();
if (!stdlibModule)
// See if the TensorFlow module was imported. If not, return null.
auto tfModule = getLoadedModule(Id_TensorFlow);
if (!tfModule)
return nullptr;

SmallVector<ValueDecl *, 1> results;
stdlibModule->lookupValue({}, getIdentifier("TensorDataType"),
NLKind::UnqualifiedLookup, results);
tfModule->lookupValue({}, getIdentifier("TensorDataType"),
NLKind::UnqualifiedLookup, results);

for (auto result : results)
if (auto CD = dyn_cast<StructDecl>(result))
Expand Down Expand Up @@ -905,6 +948,10 @@ ProtocolDecl *ASTContext::getProtocol(KnownProtocolKind kind) const {
// SWIFT_ENABLE_TENSORFLOW
case KnownProtocolKind::TensorArrayProtocol:
case KnownProtocolKind::TensorGroup:
case KnownProtocolKind::TensorFlowDataTypeCompatible:
case KnownProtocolKind::TensorProtocol:
M = getLoadedModule(Id_TensorFlow);
break;
default:
M = getStdlibModule();
break;
Expand Down
2 changes: 2 additions & 0 deletions lib/IRGen/GenMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4211,6 +4211,8 @@ SpecialProtocol irgen::getSpecialProtocolID(ProtocolDecl *P) {
case KnownProtocolKind::KeyPathIterable:
case KnownProtocolKind::TensorArrayProtocol:
case KnownProtocolKind::TensorGroup:
case KnownProtocolKind::TensorFlowDataTypeCompatible:
case KnownProtocolKind::TensorProtocol:
case KnownProtocolKind::VectorNumeric:
case KnownProtocolKind::Differentiable:
return SpecialProtocol::None;
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ set(SWIFTLIB_ESSENTIAL
StringGraphemeBreaking.swift # ORDER DEPENDENCY: Must follow UTF16.swift
ValidUTF8Buffer.swift
WriteBackMutableSlice.swift
HackyTensorflowMigrationSupport.swift
MigrationSupport.swift)

set(SWIFTLIB_ESSENTIAL_GYB_SOURCES
Expand Down
3 changes: 0 additions & 3 deletions stdlib/public/core/GroupInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@
"AutoDiff": [
"AutoDiff.swift",
],
"HackyTensorflowMigrationSupport": [
"HackyTensorflowMigrationSupport.swift",
],
"Optional": [
"Optional.swift"
],
Expand Down
80 changes: 0 additions & 80 deletions stdlib/public/core/HackyTensorflowMigrationSupport.swift

This file was deleted.

2 changes: 1 addition & 1 deletion test/Index/Store/unit-one-file-multi-file-invocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

// CHECK: [[SWIFT]]
// CHECK: DEPEND START
// CHECK: Record | system | Swift.String | [[MODULE]] | {{.+}}.swiftmodule_String-{{.*}}
// CHECK: Record | system | Swift.Math.Floating | [[MODULE]] | {{.+}}.swiftmodule_Math_Floating-{{.*}}
// CHECK: Record | system | Swift.String | [[MODULE]] | {{.+}}.swiftmodule_String-{{.*}}
// CHECK: DEPEND END

func test1() {
Expand Down
2 changes: 1 addition & 1 deletion utils/update_checkout/update-checkout-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
"clang-tools-extra": "swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a",
"libcxx": "swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a",
"tensorflow": "ebc41609e27dcf0998d8970e77a2e1f53e13ac86",
"tensorflow-swift-apis": "1d484e1826c7d4efff6d9eb66d6eb6722ce84f12",
"tensorflow-swift-apis": "835d1436a01d9261f0467bc2803cc7f6ac56ed80",
"indexstore-db": "swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a",
"sourcekit-lsp": "swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a"
}
Expand Down