aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/shape_inference.cc
diff options
context:
space:
mode:
authorGravatar Suharsh Sivakumar <suharshs@google.com>2016-08-01 22:26:29 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-08-01 23:34:01 -0700
commit18972322e9f853b6f14b823ce3569c72ca8b51ce (patch)
tree10e975afbaed79048982480051e4268fbf92ca57 /tensorflow/core/framework/shape_inference.cc
parentda1551acb6b05f536546271e730220c0bdacd218 (diff)
C++ shape inference for control flow ops.
Change: 129067423
Diffstat (limited to 'tensorflow/core/framework/shape_inference.cc')
-rw-r--r--tensorflow/core/framework/shape_inference.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/tensorflow/core/framework/shape_inference.cc b/tensorflow/core/framework/shape_inference.cc
index c66d9fb4e1..e44d921d5d 100644
--- a/tensorflow/core/framework/shape_inference.cc
+++ b/tensorflow/core/framework/shape_inference.cc
@@ -99,6 +99,14 @@ InferenceContext::~InferenceContext() {
for (auto* d : all_dims_) delete d;
}
+bool InferenceContext::FullyDefined(const Shape* s) {
+ if (!RankKnown(s)) return false;
+ for (int i = 0; i < Rank(s); ++i) {
+ if (!ValueKnown(Dim(s, i))) return false;
+ }
+ return true;
+}
+
const Dimension* InferenceContext::NumElements(const Shape* s) {
const auto rank = Rank(s);
if (rank == kUnknownRank) return UnknownDim();