aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/function_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-08-01 08:13:52 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-01 08:17:32 -0700
commit203c3f5fd49b94888f1f727252b6bb9ad779e903 (patch)
treef90b522e70c7a78db32c845b1a5e5e1cfb875fc4 /tensorflow/core/framework/function_test.cc
parent3cc5fc0886ab0a68aedd1700a4bbd58b915ab8ac (diff)
Infer unknown shapes for functions in C++
As we are implementing function support through C API, the new code path runs shape inference of Operations representing functions, but we don't yet support shape inference for functions. Before this change, adding a function NodeDef would result in error. This change pairs all functions with a shape inference function that sets all output shapes to unknown. PiperOrigin-RevId: 163830793
Diffstat (limited to 'tensorflow/core/framework/function_test.cc')
-rw-r--r--tensorflow/core/framework/function_test.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/core/framework/function_test.cc b/tensorflow/core/framework/function_test.cc
index 140dbd8932..8e15bf04ab 100644
--- a/tensorflow/core/framework/function_test.cc
+++ b/tensorflow/core/framework/function_test.cc
@@ -938,6 +938,12 @@ TEST(FunctionLibraryDefinitionTest, LookUp) {
ASSERT_NE(op_def, nullptr);
EXPECT_EQ(op_def->DebugString(),
test::function::XTimesTwo().signature().DebugString());
+
+ const OpRegistrationData* op_reg_data;
+ TF_EXPECT_OK(lib_def.LookUp("XTimesTwo", &op_reg_data));
+ ASSERT_NE(op_reg_data, nullptr);
+ // Shape inference function is initialized to UnknownShape.
+ ASSERT_NE(op_reg_data->shape_inference_fn, nullptr);
}
TEST(FunctionLibraryDefinitionTest, AddFunctionDef) {