Skip to content

Commit 43dc3f4

Browse files
author
Mingsheng Hong
committed
---
yaml --- r: 311291 b: refs/heads/tensorflow-merge c: 6ecf965 h: refs/heads/master i: 311289: f9b0f08 311287: fd23282
1 parent e356282 commit 43dc3f4

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ refs/heads/chase-my-tail: 8bb91443a9e81bbfac92a2621a0af887a1da8dbf
13791379
refs/heads/consider-outer-alternatives: 708bac749ec60a22a79e2eefbe734f9488a7370d
13801380
refs/heads/revert-25740-oops-i-linked-it-again: fdd41aeb682fc488572bdc1cf71b2ff6997ba576
13811381
refs/heads/swift-5.1-branch-06-12-2019: e63b7b2d3b93c48232d386099d0ec525d21d8f8d
1382-
refs/heads/tensorflow-merge: c31f49be3be10c113e0393097977f49de036fbf4
1382+
refs/heads/tensorflow-merge: 6ecf96572ad279394ac6413a6667bc3411bdd048
13831383
refs/heads/update-checkout-sha-info: 5832743c5c2a842976c42a508a4c6dcceefb0aef
13841384
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-12-a: 228f0448d9bb909aacbba4afcb7c600a405d15da
13851385
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-14-a: 922861a77b5fc2bf46bc917da70ceb15eef76836

branches/tensorflow-merge/stdlib/public/TensorFlow/CompilerRuntime.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ public enum _ExecutionMode : Equatable {
8282
// TODO(hongm): Revisit the longer-term design.
8383
@_frozen
8484
public enum _RuntimeConfig {
85+
/// When false, tensorflow runtime will be initialized before running any
86+
/// tensor program in this process.
87+
static public var tensorFlowRuntimeInitialized = false
88+
8589
/// When true, run the entire tensor computation in
8690
/// _TFCStartTensorComputation(), instead of running it on a separate thread.
8791
/// - Note: Set to true only for debugging purposes.
@@ -229,8 +233,11 @@ public final class _ExecutionContext {
229233

230234
// Initialize the TF runtime exactly once. Only affects local execution
231235
// (when _RuntimeConfig.tensorFlowServer is set to "").
232-
InitTensorFlowRuntime(_RuntimeConfig.printsDebugLog ? 1 : 0,
233-
_RuntimeConfig.tensorflowVerboseLogLevel)
236+
if !_RuntimeConfig.tensorFlowRuntimeInitialized {
237+
InitTensorFlowRuntime(_RuntimeConfig.printsDebugLog ? 1 : 0,
238+
_RuntimeConfig.tensorflowVerboseLogLevel)
239+
_RuntimeConfig.tensorFlowRuntimeInitialized = true
240+
}
234241

235242
guard let opts = TFE_NewContextOptions() else {
236243
fatalError("ContextOptions object can never be nil.")

branches/tensorflow-merge/test/TensorFlowRuntime/raw_ops.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,4 @@ RawOpsTests.testAllBackends("GreaterEqualOp") {
8686
testPointwiseBinaryOp(tfOp: Raw.greaterEqual, swiftOp: { $0 >= $1 })
8787
}
8888

89-
#if CPU && !CUDA
90-
runAllTestsWithRemoteSession()
91-
#else
9289
runAllTests()
93-
#endif // CPU && !CUDA

branches/tensorflow-merge/test/TensorFlowRuntime/tensor.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ func testShapeGetter4() {
508508
TensorTests.testAllBackends("ShapeGetter4", testShapeGetter4)
509509

510510
#if CPU && !CUDA
511+
// For now it is sufficient to run remote tests with test cases in this file
512+
// only. When creating new test files, consider simply calling runAllTests().
511513
runAllTestsWithRemoteSession()
512514
#else
513515
runAllTests()

0 commit comments

Comments
 (0)