Skip to content

Commit 66a08a0

Browse files
andylytensorflower-gardener
authored andcommitted
Move tests for arg and retval devices from arg-retval-attrs.pbtxt to existing device attribute test (NFC).
PiperOrigin-RevId: 346111552 Change-Id: Iaac59689e23b64416d1a0836f5c429ce52030ab4
1 parent 4479e94 commit 66a08a0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

tensorflow/compiler/mlir/tensorflow/tests/graphdef2mlir/arg-retval-attrs.pbtxt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ node {
1919
node {
2020
name: "arg1"
2121
op: "_Arg"
22-
device: "CPU:1"
2322
attr {
2423
key: "T"
2524
value {
@@ -111,7 +110,6 @@ node {
111110
name: "ret2"
112111
op: "_Retval"
113112
input: "arg2"
114-
device: "CPU:0"
115113
attr {
116114
key: "T"
117115
value {
@@ -152,6 +150,6 @@ versions {
152150
# arg/result attributes, at the right index.
153151

154152
# CHECK: func @main
155-
# CHECK-SAME: ({{%.*}}: tensor<*xf32>, {{%.*}}: tensor<*xi32> {tf._arg1_attr0 = "_arg1_attr0_value", tf._arg1_attr1 = 8.000000e+00 : f32, tf.device = "CPU:1"}, {{%.*}}: tensor<*xi1>)
156-
# CHECK-SAME: -> (tensor<*xf32> {tf._ret0_attr0 = 8 : i64, tf._ret0_attr1 = false}, tensor<*xi32>, tensor<*xi1> {tf._ret2_attr0 = !tf.variant, tf._ret2_attr1 = #tf.shape<128x1024>, tf.device = "CPU:0"})
153+
# CHECK-SAME: ({{%.*}}: tensor<*xf32>, {{%.*}}: tensor<*xi32> {tf._arg1_attr0 = "_arg1_attr0_value", tf._arg1_attr1 = 8.000000e+00 : f32}, {{%.*}}: tensor<*xi1>)
154+
# CHECK-SAME: -> (tensor<*xf32> {tf._ret0_attr0 = 8 : i64, tf._ret0_attr1 = false}, tensor<*xi32>, tensor<*xi1> {tf._ret2_attr0 = !tf.variant, tf._ret2_attr1 = #tf.shape<128x1024>})
157155
# CHECK-SAME: attributes {tf.entry_function = {control_outputs = "", inputs = "arg0,arg1,arg2", outputs = "ret0,ret1,ret2"}}

tensorflow/compiler/mlir/tensorflow/tests/graphdef2mlir/device-arg-attr.pbtxt renamed to tensorflow/compiler/mlir/tensorflow/tests/graphdef2mlir/device-arg-retval-attr.pbtxt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# RUN: tf-mlir-translate -graphdef-to-mlir -tf-enable-shape-inference-on-import=false %s -tf-graph-as-function -o - | FileCheck %s
22

3-
# Verify arg devices are added as arg attributes.
3+
# Verify arg and ret devices are added as arg and ret attributes.
44

55
# CHECK-LABEL: func @main
6-
# CHECK-SAME: (%[[ARG_0:[a-z0-9]+]]: tensor<*xf32> {tf.device = "/CPU:0"}, %[[ARG_1:[a-z0-9]+]]: tensor<2x4x6x8xi32>) -> (tensor<*xf32>, tensor<*xi32>)
6+
# CHECK-SAME: (%[[ARG_0:[a-z0-9]+]]: tensor<*xf32> {tf.device = "/CPU:0"}, %[[ARG_1:[a-z0-9]+]]: tensor<2x4x6x8xi32>) -> (tensor<*xf32>, tensor<*xi32> {tf.device = "/CPU:1"})
77

88
node {
99
name: "args_0"
@@ -95,6 +95,7 @@ node {
9595
name: "rets_1"
9696
op: "_Retval"
9797
input: "identity:1"
98+
device: "/CPU:1"
9899
attr {
99100
key: "T"
100101
value {

0 commit comments

Comments
 (0)