Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Fix TensorFlow stdlib module compilation. #546

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

dan-zheng
Copy link
Member

@dan-zheng dan-zheng commented Nov 7, 2019

Follow-up to #540 fixing TensorFlow stdlib module compilation.


  1. Rename Sources/Tensor/Utilities.swift → Sources/Tensor/TensorUtilities.swift to fix stdlib compilation errors:
<unknown>:0: error: filename "Utilities.swift" used twice: '/usr/local/google/home/saeta/src/s4tf6/tensorflow-swift-apis/Sources/Tensor/Utilities.swift' and '/usr/local/google/home/saeta/src/s4tf6/tensorflow-swift-apis/Sources/TensorFlow/Core/Utilities.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
  1. Add #if !COMPILING_TENSORFLOW_STDLIB_MODULE guards gating import Tensor
    declarations so that the TensorFlow module can be built as part of the stdlib.

This will no longer be necessary when TensorFlow is no longer built as part of
the stdlib: #488.


Friend PR: swiftlang/swift#28124

`#if !COMPILING_TENSORFLOW_STDLIB_MODULE` is necessary to gate `import Tensor`
declarations so that the TensorFlow module can be built as part of the stdlib.

This will no longer be necessary when TensorFlow is no longer built as part of
the stdlib: tensorflow#488.
@dan-zheng dan-zheng requested review from saeta and eaplatanios and removed request for saeta November 7, 2019 01:49
@dan-zheng dan-zheng changed the title Gate imports with #if !COMPILING_TENSORFLOW_STDLIB_MODULE. Fix TensorFlow stdlib module compilation. Nov 7, 2019
Copy link
Contributor

@saeta saeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dan-zheng dan-zheng merged commit 1aceb2d into tensorflow:master Nov 7, 2019
@dan-zheng dan-zheng deleted the fix-tf-stdlib-compilation branch November 7, 2019 02:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants