aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/user_ops
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2018-02-21 13:14:27 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-21 13:18:18 -0800
commit5196f05d3c150b66a9a5f7eeb9b476780f771b81 (patch)
tree8b5efabbcbb7fd82f384c1dd6e7521209088ca65 /tensorflow/core/user_ops
parent7e8b4a09416e453555073a88b0fd47625e0c5036 (diff)
Add test that checks all core ops have shape functions.
This is meant to be a replacement for the current Python code that checks that core ops have shape functions registered. Some ops were missing a shape function, so I added UnknownShape. This also adds an OpRegistry::GetOpRegistrationData() method for fetching all the shape functions. PiperOrigin-RevId: 186508356
Diffstat (limited to 'tensorflow/core/user_ops')
-rw-r--r--tensorflow/core/user_ops/fact.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/core/user_ops/fact.cc b/tensorflow/core/user_ops/fact.cc
index 3a4fc8115a..2e8b22a49b 100644
--- a/tensorflow/core/user_ops/fact.cc
+++ b/tensorflow/core/user_ops/fact.cc
@@ -15,10 +15,13 @@ limitations under the License.
// An example Op.
+#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
-REGISTER_OP("Fact").Output("fact: string");
+REGISTER_OP("Fact")
+ .Output("fact: string")
+ .SetShapeFn(tensorflow::shape_inference::UnknownShape);
class FactOp : public tensorflow::OpKernel {
public: