Skip to content

Commit

Permalink
Do not use deprecated usePropertiesAsAttributes=0 for tf_saved_model …
Browse files Browse the repository at this point in the history
…ops.

PiperOrigin-RevId: 578099160
  • Loading branch information
akuegel authored and tensorflower-gardener committed Oct 31, 2023
1 parent 3d74f34 commit ebdfab6
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module attributes {tf_saved_model.semantics} {
}

"tf_saved_model.session_initializer"() {initializers = [@init_all_tables]} : () -> ()
// CHECK: "tf_saved_model.session_initializer"() {initializers = [@init_all_tables]} : () -> ()
// CHECK: "tf_saved_model.session_initializer"() <{initializers = [@init_all_tables]}> : () -> ()

// CHECK-LABEL: serving_default
func.func @serving_default(%arg0: tensor<1x10xf32> {tf_saved_model.index_path = ["x"]}) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ module attributes {tf.versions = {producer = 1132 : i32}, tf_saved_model.semanti
"tf_saved_model.session_initializer"() {initializers = [@NoOp]} : () -> ()
"tf_saved_model.asset"() {filename = "assets/mydata.txt", sym_name = "__tf_saved_model_asset0_mydata.txt"} : () -> ()
// Session initializer ops and asset ops untouched.
// CHECK: "tf_saved_model.session_initializer"() {initializers = [@NoOp]} : () -> ()
// CHECK: "tf_saved_model.asset"() {filename = "assets/mydata.txt", sym_name = "__tf_saved_model_asset0_mydata.txt"} : () -> ()
// CHECK: "tf_saved_model.session_initializer"() <{initializers = [@NoOp]}> : () -> ()
// CHECK: "tf_saved_model.asset"() <{filename = "assets/mydata.txt", sym_name = "__tf_saved_model_asset0_mydata.txt"}> : () -> ()

func.func @NoOp(%arg0: tensor<!tf_type.string> {tf_saved_model.bound_input = @__tf_saved_model_asset0_mydata.txt}) attributes {tf_saved_model.exported_names = ["__tf_saved_model_session_initializer_NoOp"]} {
%0 = "tf.HashTableV2"() {container = "", device = "", key_dtype = !tf_type.string, shared_name = "", use_node_name_sharing = false, value_dtype = i64} : () -> tensor<!tf_type.resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func.func @NoOp_0(%arg0: tensor<!tf_type.string> {tf_saved_model.bound_input = @
// CHECK-LABEL: module
module attributes {tf_saved_model.semantics} {
"tf_saved_model.session_initializer"() {initializers = [@init_func_restore_op]} : () -> ()
// CHECK: "tf_saved_model.session_initializer"() {initializers = []}
// CHECK: "tf_saved_model.session_initializer"() <{initializers = []}>

func.func @init_func_restore_op(%arg: tensor<!tf_type.string> {tf_saved_model.index_path = ["__tf_file_prefix"]})
attributes {tf_saved_model.exported_names = ["__tf_saved_model_session_initializer_NoOp"], tf_saved_model.initializer_type = "restore_op"} {
Expand Down Expand Up @@ -383,7 +383,7 @@ module attributes {tf.versions = {bad_consumers = [], min_consumer = 12 : i32, p
// CHECK-LABEL: module
module attributes {tf_saved_model.semantics} {
"tf_saved_model.session_initializer"() {initializers = [@init_func_restore_op]} : () -> ()
// CHECK: "tf_saved_model.session_initializer"() {initializers = []}
// CHECK: "tf_saved_model.session_initializer"() <{initializers = []}>

func.func @init_func_restore_op(%arg: tensor<!tf_type.string> {tf_saved_model.index_path = ["file_prefix"]})
attributes {tf_saved_model.exported_names = ["__tf_saved_model_session_initializer_NoOp"], tf_saved_model.initializer_type = "restore_op"} {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def TfSavedModel_Dialect : Dialect {
}];

let cppNamespace = "::mlir::tf_saved_model";
let usePropertiesForAttributes = 0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def __init__(self):
self.c43 = tf.constant(43.0)

# During serialization, the constants are given internal (non-user-accessible, non-semantically-load-bearing) exported names.
# CHECK: "tf_saved_model.global_tensor"() {sym_name = "[[CONST:[a-zA-Z_0-9.]+]]", tf_saved_model.exported_names = [{{.*}}], type = tensor<f32>, value = dense<4.300000e+01> : tensor<f32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{sym_name = "[[CONST:[a-zA-Z_0-9.]+]]", type = tensor<f32>, value = dense<4.300000e+01> : tensor<f32>}> {tf_saved_model.exported_names = [{{.*}}]} : () -> ()

# CHECK: "tf_saved_model.global_tensor"() {is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", tf_saved_model.exported_names = ["v42"], type = tensor<f32>, value = dense<4.200000e+01> : tensor<f32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<f32>, value = dense<4.200000e+01> : tensor<f32>}> {tf_saved_model.exported_names = ["v42"]} : () -> ()
# CHECK: func {{@[a-zA-Z_0-9]+}}(
# CHECK-SAME: %arg0: tensor<f32> {tf._user_specified_name = "x", tf_saved_model.index_path = [0]},
# CHECK-SAME: %arg1: tensor<!tf_type.resource<tensor<f32>>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# CHECK-SAME: min_consumer
# CHECK-SAME: producer

# CHECK: "tf_saved_model.global_tensor"() {is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<1x3xf32>, value = {{.*}} : tensor<1x3xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<1x3xf32>, value = {{.*}} : tensor<1x3xf32>}> : () -> ()

# CHECK: func {{@[a-zA-Z_0-9]+}}(
# CHECK-SAME: [[ARG0:%.*]]: tensor<3x1xf32> {tf_saved_model.index_path = ["x"]},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import tensorflow.compat.v1 as tf
from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common_v1

# CHECK: "tf_saved_model.session_initializer"() {initializers = [@[[init:.*]]]} : () -> ()
# CHECK: "tf_saved_model.asset"() {filename = {{.*}}, sym_name = "[[asset1:__tf_saved_model_asset1_.*]]"}
# CHECK: "tf_saved_model.asset"() {filename = {{.*}}, sym_name = "[[asset0:__tf_saved_model_asset0_.*]]"}
# CHECK: "tf_saved_model.session_initializer"() <{initializers = [@[[init:.*]]]}> : () -> ()
# CHECK: "tf_saved_model.asset"() <{filename = {{.*}}, sym_name = "[[asset1:__tf_saved_model_asset1_.*]]"}>
# CHECK: "tf_saved_model.asset"() <{filename = {{.*}}, sym_name = "[[asset0:__tf_saved_model_asset0_.*]]"}>

# CHECK: func @[[init]]
# CHECK-SAME: [[ARG0:%.*]]: tensor<!tf_type.string> {tf_saved_model.bound_input = @[[asset0]]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# CHECK-SAME: producer

# CHECK: "tf_saved_model.global_tensor"()
# CHECK: "tf_saved_model.session_initializer"() {initializers = [@[[init:.*]]]} : () -> ()
# CHECK: "tf_saved_model.session_initializer"() <{initializers = [@[[init:.*]]]}> : () -> ()

# CHECK: func @[[init]]
# CHECK-SAME: tf_saved_model.initializer_type = "init_op"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# CHECK-SAME: initializers = [@[[restore:.*]]]

# CHECK: "tf_saved_model.asset"()
# CHECK-SAME: {filename = [[filename:.*]], sym_name = "[[sym_name:.*]]"} : () -> ()
# CHECK-SAME: <{filename = [[filename:.*]], sym_name = "[[sym_name:.*]]"}> : () -> ()

# CHECK: func @[[restore]](
# CHECK-SAME: [[variable_path:%.*]]: tensor<!tf_type.string> {tf_saved_model.bound_input = @[[sym_name]]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# CHECK-SAME: producer

# CHECK: "tf_saved_model.global_tensor"()
# CHECK: "tf_saved_model.session_initializer"() {initializers = [@[[INIT_FUNC:[a-zA-Z_0-9]+]]]} : () -> ()
# CHECK: "tf_saved_model.session_initializer"() <{initializers = [@[[INIT_FUNC:[a-zA-Z_0-9]+]]]}> : () -> ()

# Initializer function. This should contain the initialization sequence for the
# variable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import tensorflow.compat.v1 as tf
from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common_v1

# CHECK: "tf_saved_model.global_tensor"() {is_mutable, sym_name = "[[VAR0:[a-zA-Z_0-9]+]]", type = tensor<5x3xf32>, value = {{.*}} : tensor<5x3xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() {is_mutable, sym_name = "[[VAR1:[a-zA-Z_0-9]+]]", type = tensor<3x5xf32>, value = {{.*}} : tensor<3x5xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, sym_name = "[[VAR0:[a-zA-Z_0-9]+]]", type = tensor<5x3xf32>, value = {{.*}} : tensor<5x3xf32>}> : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, sym_name = "[[VAR1:[a-zA-Z_0-9]+]]", type = tensor<3x5xf32>, value = {{.*}} : tensor<3x5xf32>}> : () -> ()
# CHECK: func {{@[a-zA-Z_0-9]+}}(
# CHECK-SAME: [[ARG0:%.*]]: tensor<!tf_type.resource<tensor<5x3xf32>>> {tf_saved_model.bound_input = @[[VAR0]]},
# CHECK-SAME: [[ARG1:%.*]]: tensor<!tf_type.resource<tensor<3x5xf32>>> {tf_saved_model.bound_input = @[[VAR1]]})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class TestModule(tf.Module):

def __init__(self):
super(TestModule, self).__init__()
# CHECK: "tf_saved_model.global_tensor"() {is_mutable, {{.*}} tf_saved_model.exported_names = ["v0"], type = tensor<*xf32>, value = dense<0.000000e+00> : tensor<1xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() {is_mutable, {{.*}} tf_saved_model.exported_names = ["v1"], type = tensor<?xf32>, value = dense<[0.000000e+00, 1.000000e+00]> : tensor<2xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, {{.*}} type = tensor<*xf32>, value = dense<0.000000e+00> : tensor<1xf32>}> {tf_saved_model.exported_names = ["v0"]} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, {{.*}} type = tensor<?xf32>, value = dense<[0.000000e+00, 1.000000e+00]> : tensor<2xf32>}> {tf_saved_model.exported_names = ["v1"]} : () -> ()
self.v0 = tf.Variable([0.], shape=tf.TensorShape(None))
self.v1 = tf.Variable([0., 1.], shape=[None])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# CHECK-SAME: min_consumer
# CHECK-SAME: producer

# CHECK: "tf_saved_model.global_tensor"() {is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<1x3xf32>, value = {{.*}} : tensor<1x3xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<1x3xf32>, value = {{.*}} : tensor<1x3xf32>}> : () -> ()
# CHECK-NOT: session_initializer

# CHECK: func {{@[a-zA-Z_0-9]+}}(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import tensorflow.compat.v1 as tf
from tensorflow.compiler.mlir.tensorflow.tests.tf_saved_model import common_v1

# CHECK: "tf_saved_model.global_tensor"() {is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<1x3xf32>, value = {{.*}} : tensor<1x3xf32>} : () -> ()
# CHECK: "tf_saved_model.global_tensor"() <{is_mutable, sym_name = "[[VAR:[a-zA-Z_0-9]+]]", type = tensor<1x3xf32>, value = {{.*}} : tensor<1x3xf32>}> : () -> ()

# CHECK: func {{@[a-zA-Z_0-9]+}}(
# CHECK-SAME: [[ARG0:%.*]]: tensor<3x1xf32> {tf_saved_model.index_path = ["x"]},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module attributes {tf_saved_model.semantics} {

// Test case: Basic test of marking immutable.

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-NOT: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}) -> (tensor<f32> {tf_saved_model.index_path = []})
Expand All @@ -27,9 +27,9 @@ module attributes {tf_saved_model.semantics} {

// Test case: Don't mark immutable if the variable is mutated.

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v})
Expand All @@ -47,9 +47,9 @@ module attributes {tf_saved_model.semantics} {

// Test case: Don't mark immutable if the variable is exported.

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> {{{.*}}} : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", tf_saved_model.exported_names = ["v"], type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}) -> (tensor<f32> {tf_saved_model.index_path = []})
Expand Down Expand Up @@ -148,9 +148,9 @@ module {}
// Test use as an input in unhandled op
module attributes {tf_saved_model.semantics} {

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v})
Expand All @@ -166,9 +166,9 @@ module attributes {tf_saved_model.semantics} {
// Test use as a region capture in an unhandled op
module attributes {tf_saved_model.semantics} {

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v})
Expand All @@ -187,14 +187,14 @@ module attributes {tf_saved_model.semantics} {
// to the unhandled op.
module attributes {tf_saved_model.semantics} {

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "u", type = tensor<f32>, value = dense<22.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}, %arg1: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @u})
Expand All @@ -212,14 +212,14 @@ module attributes {tf_saved_model.semantics} {
// Test multiple global tensors uses as operands for an unhandled op.
module attributes {tf_saved_model.semantics} {

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "u", type = tensor<f32>, value = dense<22.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}, %arg1: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @u})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module attributes {tf_saved_model.semantics} {
// Test case: This test exercises marking a global tensor as immutable after it propagates
// via set of chained calls -> f -> f_callee -> f_callee_callee

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-NOT: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}) -> (tensor<f32> {tf_saved_model.index_path = []})
Expand Down Expand Up @@ -39,11 +39,11 @@ module attributes {tf_saved_model.semantics} {
// Test case:
// This test exercises trying to mark immutable when same func is called by multiple callers
// with different global tensors.
// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-NOT: is_mutable
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-NOT: is_mutable
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v2", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

Expand Down Expand Up @@ -73,9 +73,9 @@ module attributes {tf_saved_model.semantics} {
// Test case: This test exercises immutability without explicit use
// via ReadVariableOp

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-NOT: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}) -> (tensor<f32> {tf_saved_model.index_path = []})
Expand All @@ -99,9 +99,9 @@ module attributes {tf_saved_model.semantics} {

// CHECK-LABEL: module attributes {tf_saved_model.semantics}
module attributes {tf_saved_model.semantics} {
// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

// CHECK: func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v})
Expand Down Expand Up @@ -133,9 +133,9 @@ module attributes {tf_saved_model.semantics} {
// Test case: The inter-procedural analysis with different types of
// TF call ops

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

// CHECK: func @f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v})
Expand Down Expand Up @@ -166,9 +166,9 @@ module attributes {tf_saved_model.semantics} {

// Test case: The inter-procedural analysis does not recurse infinitely

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-NOT: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @exported_f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}) -> (tensor<f32> {tf_saved_model.index_path = []})
Expand Down Expand Up @@ -199,9 +199,9 @@ module attributes {tf_saved_model.semantics} {
// Test case: Inter-procedural analysis with resource usage in an
// unknown op, we assume mutating behavior and propagate that.

// CHECK: "tf_saved_model.global_tensor"() {
// CHECK: "tf_saved_model.global_tensor"() <{
// CHECK-SAME: is_mutable
// CHECK-SAME: } : () -> ()
// CHECK-SAME: }> : () -> ()
"tf_saved_model.global_tensor"() { is_mutable, sym_name = "v", type = tensor<f32>, value = dense<42.> : tensor<f32> } : () -> ()

func.func @exported_f(%arg0: tensor<!tf_type.resource<tensor<f32>>> {tf_saved_model.bound_input = @v}) -> (tensor<f32> {tf_saved_model.index_path = []})
Expand Down

0 comments on commit ebdfab6

Please sign in to comment.