diff options
author | Suharsh Sivakumar <suharshs@google.com> | 2016-08-01 22:26:29 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-08-01 23:34:01 -0700 |
commit | 18972322e9f853b6f14b823ce3569c72ca8b51ce (patch) | |
tree | 10e975afbaed79048982480051e4268fbf92ca57 /tensorflow/core/framework/shape_inference.cc | |
parent | da1551acb6b05f536546271e730220c0bdacd218 (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.cc | 8 |
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(); |