Skip to content

Commit ad40c41

Browse files
authored
---
yaml --- r: 262078 b: refs/heads/tensorflow c: 1cd29f7 h: refs/heads/master
1 parent d30379e commit ad40c41

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
818818
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
819819
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
820820
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
821-
refs/heads/tensorflow: 63500997eeb59d154854863865c2fffd013fd0f5
821+
refs/heads/tensorflow: 1cd29f7f6b9d69819306c0bb92428e0e144084fe
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
823823
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
824824
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/lib/SILOptimizer/Mandatory/TFUtilities.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,20 +264,25 @@ bool tf::isStatefulOp(const GraphOperationInst *graphOp) {
264264
StringRef tensorOpName = decoder.getOperationName();
265265
// Is this a known stateful op used in partitioning?
266266
if (tensorOpName.startswith("tfc.SendToHost") ||
267-
tensorOpName.startswith("tfc.RecvFromHost")) {
267+
tensorOpName.startswith("tfc.RecvFromHost") ||
268+
tensorOpName.startswith("tfc.D2DTensorRecv") ||
269+
tensorOpName.startswith("tfc.D2DTensorSend") ||
270+
tensorOpName.startswith("tfc.TensorTransfer")) {
268271
return true;
269272
}
273+
// Other ops only known to Swift for TensorFlow.
274+
if (tensorOpName.startswith("tf_tensor_to_i1") ||
275+
tensorOpName.startswith("tfc.")) {
276+
return false;
277+
}
270278
// Is this a stateful TensorFlow op?
271279
std::unique_ptr<TF_Status, decltype(&TF_DeleteStatus)> status(
272280
TF_NewStatus(), TF_DeleteStatus);
273281
int isStateful = TF_OpIsStateful(tensorOpName.str().c_str(), status.get());
274282
TF_Code statusCode = TF_GetCode(status.get());
275-
// FIXME(SR-9388): we should actually fail if statusCode != TF_OK. However,
276-
// the current tests use arbitrary strings in graph_op. Therefore, we will
277-
// just allow TF_NOT_FOUND for now to avoid changing too many tests.
278-
assert((statusCode == TF_OK || statusCode == TF_NOT_FOUND) &&
283+
assert(statusCode == TF_OK &&
279284
"Error checking if a TensorFlow op is stateful.");
280-
return (statusCode == TF_OK && isStateful);
285+
return isStateful;
281286
}
282287

283288
/// Create a "Const" tensor operation containing the specified scalars, with

branches/tensorflow/test/TensorFlow/canonicalize_cfg_xla.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ bb2(%14 : $TensorCore<Builtin.Int64>, %15 : $TensorCore<Float>): // Preds: bb3 b
4949
%16 = graph_op "Add"(%14 : $TensorCore<Builtin.Int64>, %9 : $TensorCore<Builtin.Int64>) : $TensorCore<Builtin.Int64> // users: %23, %17
5050
%17 = graph_op "Equal"(%16 : $TensorCore<Builtin.Int64>, %5 : $TensorCore<Builtin.Int64>) : $TensorCore<Builtin.Int1> // user: %21
5151
%18 = graph_op "Add"(%15 : $TensorCore<Float>, %15 : $TensorCore<Float>) : $TensorCore<Float> // user: %19
52-
%19 = graph_op "tensorflowSend"(%18 : $TensorCore<Float>) : $()
53-
%20 = graph_op "tensorflowReceive"() : $TensorCore<Float> // users: %12, %23, %11, %11
52+
%19 = graph_op "Identity"(%18 : $TensorCore<Float>) : $()
53+
%20 = graph_op "Const"() : $TensorCore<Float> // users: %12, %23, %11, %11
5454
%21 = graph_op "tf_tensor_to_i1"(%17 : $TensorCore<Builtin.Int1>) : $Builtin.Int1 // user: %22
5555
cond_br %21, bb1, bb3 // id: %22
5656

0 commit comments

Comments
 (0)