File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed
branches/tensorflow-merge Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -1379,7 +1379,7 @@ refs/heads/chase-my-tail: 8bb91443a9e81bbfac92a2621a0af887a1da8dbf
1379
1379
refs/heads/consider-outer-alternatives: 708bac749ec60a22a79e2eefbe734f9488a7370d
1380
1380
refs/heads/revert-25740-oops-i-linked-it-again: fdd41aeb682fc488572bdc1cf71b2ff6997ba576
1381
1381
refs/heads/swift-5.1-branch-06-12-2019: e63b7b2d3b93c48232d386099d0ec525d21d8f8d
1382
- refs/heads/tensorflow-merge: c31f49be3be10c113e0393097977f49de036fbf4
1382
+ refs/heads/tensorflow-merge: 6ecf96572ad279394ac6413a6667bc3411bdd048
1383
1383
refs/heads/update-checkout-sha-info: 5832743c5c2a842976c42a508a4c6dcceefb0aef
1384
1384
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-12-a: 228f0448d9bb909aacbba4afcb7c600a405d15da
1385
1385
refs/tags/swift-5.1-DEVELOPMENT-SNAPSHOT-2019-06-14-a: 922861a77b5fc2bf46bc917da70ceb15eef76836
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ public enum _ExecutionMode : Equatable {
82
82
// TODO(hongm): Revisit the longer-term design.
83
83
@_frozen
84
84
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
+
85
89
/// When true, run the entire tensor computation in
86
90
/// _TFCStartTensorComputation(), instead of running it on a separate thread.
87
91
/// - Note: Set to true only for debugging purposes.
@@ -229,8 +233,11 @@ public final class _ExecutionContext {
229
233
230
234
// Initialize the TF runtime exactly once. Only affects local execution
231
235
// (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
+ }
234
241
235
242
guard let opts = TFE_NewContextOptions ( ) else {
236
243
fatalError ( " ContextOptions object can never be nil. " )
Original file line number Diff line number Diff line change @@ -86,8 +86,4 @@ RawOpsTests.testAllBackends("GreaterEqualOp") {
86
86
testPointwiseBinaryOp ( tfOp: Raw . greaterEqual, swiftOp: { $0 >= $1 } )
87
87
}
88
88
89
- #if CPU && !CUDA
90
- runAllTestsWithRemoteSession ( )
91
- #else
92
89
runAllTests ( )
93
- #endif // CPU && !CUDA
Original file line number Diff line number Diff line change @@ -508,6 +508,8 @@ func testShapeGetter4() {
508
508
TensorTests . testAllBackends ( " ShapeGetter4 " , testShapeGetter4)
509
509
510
510
#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().
511
513
runAllTestsWithRemoteSession ( )
512
514
#else
513
515
runAllTests ( )
You can’t perform that action at this time.
0 commit comments