aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/cc/saved_model
diff options
context:
space:
mode:
authorGravatar Kiril Gorovoy <kgorovoy@google.com>2017-01-27 09:06:29 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-01-27 09:24:36 -0800
commit4c420657c8b854354c21d30ae78624c30151eb25 (patch)
tree5fd9eec8f54593b785be680f3b2fae882b054fae /tensorflow/cc/saved_model
parent54b2180f996d69ca6558cdc07939a5887ba52d80 (diff)
Add additional named signatures to test half_plus_two model.
Change: 145801253
Diffstat (limited to 'tensorflow/cc/saved_model')
-rw-r--r--tensorflow/cc/saved_model/loader_test.cc2
-rwxr-xr-xtensorflow/cc/saved_model/testdata/half_plus_two/00000123/saved_model.pbbin8618 -> 9975 bytes
-rwxr-xr-xtensorflow/cc/saved_model/testdata/half_plus_two_pbtxt/00000123/saved_model.pbtxt437
3 files changed, 407 insertions, 32 deletions
diff --git a/tensorflow/cc/saved_model/loader_test.cc b/tensorflow/cc/saved_model/loader_test.cc
index 84aa51110f..2a8a7c5bff 100644
--- a/tensorflow/cc/saved_model/loader_test.cc
+++ b/tensorflow/cc/saved_model/loader_test.cc
@@ -67,7 +67,7 @@ class LoaderTest : public ::testing::Test {
ValidateAssets(export_dir, bundle);
// Retrieve the regression signature from meta graph def.
const auto signature_def_map = bundle.meta_graph_def.signature_def();
- const auto signature_def = signature_def_map.at(kRegressMethodName);
+ const auto signature_def = signature_def_map.at("regress_x_to_y");
const string input_name = signature_def.inputs().at(kRegressInputs).name();
const string output_name =
diff --git a/tensorflow/cc/saved_model/testdata/half_plus_two/00000123/saved_model.pb b/tensorflow/cc/saved_model/testdata/half_plus_two/00000123/saved_model.pb
index c27ffda3b8..c5727b1e47 100755
--- a/tensorflow/cc/saved_model/testdata/half_plus_two/00000123/saved_model.pb
+++ b/tensorflow/cc/saved_model/testdata/half_plus_two/00000123/saved_model.pb
Binary files differ
diff --git a/tensorflow/cc/saved_model/testdata/half_plus_two_pbtxt/00000123/saved_model.pbtxt b/tensorflow/cc/saved_model/testdata/half_plus_two_pbtxt/00000123/saved_model.pbtxt
index 1e4f606ac3..8aa2e32b46 100755
--- a/tensorflow/cc/saved_model/testdata/half_plus_two_pbtxt/00000123/saved_model.pbtxt
+++ b/tensorflow/cc/saved_model/testdata/half_plus_two_pbtxt/00000123/saved_model.pbtxt
@@ -289,6 +289,38 @@ meta_graphs {
}
}
op {
+ name: "Reshape"
+ input_arg {
+ name: "tensor"
+ type_attr: "T"
+ }
+ input_arg {
+ name: "shape"
+ type_attr: "Tshape"
+ }
+ output_arg {
+ name: "output"
+ type_attr: "T"
+ }
+ attr {
+ name: "T"
+ type: "type"
+ }
+ attr {
+ name: "Tshape"
+ type: "type"
+ default_value {
+ type: DT_INT32
+ }
+ allowed_values {
+ list {
+ type: DT_INT32
+ type: DT_INT64
+ }
+ }
+ }
+ }
+ op {
name: "RestoreV2"
input_arg {
name: "prefix"
@@ -383,7 +415,7 @@ meta_graphs {
}
}
op {
- name: "Variable"
+ name: "VariableV2"
output_arg {
name: "ref"
type_attr: "dtype"
@@ -451,7 +483,7 @@ meta_graphs {
}
node {
name: "a"
- op: "Variable"
+ op: "VariableV2"
attr {
key: "_output_shapes"
value {
@@ -588,7 +620,7 @@ meta_graphs {
}
node {
name: "b"
- op: "Variable"
+ op: "VariableV2"
attr {
key: "_output_shapes"
value {
@@ -725,7 +757,7 @@ meta_graphs {
}
node {
name: "c"
- op: "Variable"
+ op: "VariableV2"
attr {
key: "_output_shapes"
value {
@@ -891,6 +923,108 @@ meta_graphs {
}
}
node {
+ name: "ParseExample/key_x2"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_FLOAT
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ float_val: 0.0
+ }
+ }
+ }
+ }
+ node {
+ name: "ParseExample/Reshape/shape"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_INT32
+ tensor_shape {
+ dim {
+ size: 1
+ }
+ }
+ int_val: 1
+ }
+ }
+ }
+ }
+ node {
+ name: "ParseExample/Reshape"
+ op: "Reshape"
+ input: "ParseExample/key_x2"
+ input: "ParseExample/Reshape/shape"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "Tshape"
+ value {
+ type: DT_INT32
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
name: "ParseExample/ParseExample/names"
op: "Const"
attr {
@@ -954,16 +1088,48 @@ meta_graphs {
}
}
node {
+ name: "ParseExample/ParseExample/dense_keys_1"
+ op: "Const"
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ }
+ }
+ }
+ }
+ attr {
+ key: "dtype"
+ value {
+ type: DT_STRING
+ }
+ }
+ attr {
+ key: "value"
+ value {
+ tensor {
+ dtype: DT_STRING
+ tensor_shape {
+ }
+ string_val: "x2"
+ }
+ }
+ }
+ }
+ node {
name: "ParseExample/ParseExample"
op: "ParseExample"
input: "tf_example"
input: "ParseExample/ParseExample/names"
input: "ParseExample/ParseExample/dense_keys_0"
+ input: "ParseExample/ParseExample/dense_keys_1"
input: "ParseExample/Const"
+ input: "ParseExample/Reshape"
attr {
key: "Ndense"
value {
- i: 1
+ i: 2
}
}
attr {
@@ -977,6 +1143,7 @@ meta_graphs {
value {
list {
type: DT_FLOAT
+ type: DT_FLOAT
}
}
}
@@ -992,6 +1159,14 @@ meta_graphs {
size: 1
}
}
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
}
}
}
@@ -1004,6 +1179,11 @@ meta_graphs {
size: 1
}
}
+ shape {
+ dim {
+ size: 1
+ }
+ }
}
}
}
@@ -1096,34 +1276,87 @@ meta_graphs {
}
}
node {
- name: "x2"
- op: "Placeholder"
+ name: "Mul_1"
+ op: "Mul"
+ input: "a/read"
+ input: "x"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
attr {
key: "_output_shapes"
value {
list {
shape {
- unknown_rank: true
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
}
}
}
}
+ }
+ node {
+ name: "y2"
+ op: "Add"
+ input: "Mul_1"
+ input: "c/read"
attr {
- key: "dtype"
+ key: "T"
value {
type: DT_FLOAT
}
}
attr {
- key: "shape"
+ key: "_output_shapes"
value {
- shape {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
}
}
}
}
node {
- name: "Mul_1"
+ name: "x2"
+ op: "Identity"
+ input: "ParseExample/ParseExample:1"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Mul_2"
op: "Mul"
input: "a/read"
input: "x2"
@@ -1138,16 +1371,21 @@ meta_graphs {
value {
list {
shape {
- unknown_rank: true
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
}
}
}
}
}
node {
- name: "y2"
+ name: "y3"
op: "Add"
- input: "Mul_1"
+ input: "Mul_2"
input: "c/read"
attr {
key: "T"
@@ -1160,7 +1398,12 @@ meta_graphs {
value {
list {
shape {
- unknown_rank: true
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
}
}
}
@@ -1228,7 +1471,7 @@ meta_graphs {
}
node {
name: "filename_tensor"
- op: "Variable"
+ op: "VariableV2"
attr {
key: "_output_shapes"
value {
@@ -1405,6 +1648,13 @@ meta_graphs {
}
}
node {
+ name: "init"
+ op: "NoOp"
+ input: "^a/Assign"
+ input: "^b/Assign"
+ input: "^c/Assign"
+ }
+ node {
name: "Identity"
op: "Identity"
input: "y"
@@ -1431,11 +1681,82 @@ meta_graphs {
}
}
node {
- name: "init"
- op: "NoOp"
- input: "^a/Assign"
- input: "^b/Assign"
- input: "^c/Assign"
+ name: "Identity_1"
+ op: "Identity"
+ input: "y2"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Identity_2"
+ op: "Identity"
+ input: "y3"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
+ }
+ node {
+ name: "Identity_3"
+ op: "Identity"
+ input: "y"
+ attr {
+ key: "T"
+ value {
+ type: DT_FLOAT
+ }
+ }
+ attr {
+ key: "_output_shapes"
+ value {
+ list {
+ shape {
+ dim {
+ size: -1
+ }
+ dim {
+ size: 1
+ }
+ }
+ }
+ }
+ }
}
node {
name: "group_deps"
@@ -1497,7 +1818,7 @@ meta_graphs {
dtype: DT_STRING
tensor_shape {
}
- string_val: "_temp_1a28a38846ca4725a95f6197642f9def/part"
+ string_val: "_temp_4b2cbc38e16546cba7f82afaf4c75e7d/part"
}
}
}
@@ -2227,7 +2548,7 @@ meta_graphs {
input: "^save/restore_shard"
}
versions {
- producer: 19
+ producer: 21
}
}
saver_def {
@@ -2287,25 +2608,43 @@ meta_graphs {
}
}
signature_def {
- key: "serving_default"
+ key: "classify_x_to_y"
value {
inputs {
- key: "x"
+ key: "inputs"
value {
- name: "x:0"
+ name: "tf_example:0"
}
}
outputs {
- key: "y"
+ key: "scores"
value {
- name: "y:0"
+ name: "Identity_3:0"
}
}
- method_name: "tensorflow/serving/predict"
+ method_name: "tensorflow/serving/classify"
+ }
+ }
+ signature_def {
+ key: "regress_x2_to_y3"
+ value {
+ inputs {
+ key: "inputs"
+ value {
+ name: "x2:0"
+ }
+ }
+ outputs {
+ key: "outputs"
+ value {
+ name: "Identity_2:0"
+ }
+ }
+ method_name: "tensorflow/serving/regress"
}
}
signature_def {
- key: "tensorflow/serving/regress"
+ key: "regress_x_to_y"
value {
inputs {
key: "inputs"
@@ -2322,4 +2661,40 @@ meta_graphs {
method_name: "tensorflow/serving/regress"
}
}
+ signature_def {
+ key: "regress_x_to_y2"
+ value {
+ inputs {
+ key: "inputs"
+ value {
+ name: "tf_example:0"
+ }
+ }
+ outputs {
+ key: "outputs"
+ value {
+ name: "Identity_1:0"
+ }
+ }
+ method_name: "tensorflow/serving/regress"
+ }
+ }
+ signature_def {
+ key: "serving_default"
+ value {
+ inputs {
+ key: "x"
+ value {
+ name: "x:0"
+ }
+ }
+ outputs {
+ key: "y"
+ value {
+ name: "y:0"
+ }
+ }
+ method_name: "tensorflow/serving/predict"
+ }
+ }
}