Add TF_TryEvaluateConstant to the C API and have smart_cond call it.
authorSkye Wanderman-Milne <skyewm@google.com>
Tue, 6 Mar 2018 21:38:56 +0000 (13:38 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 6 Mar 2018 21:42:58 +0000 (13:42 -0800)
commit1d64f9038084095bf92a8ca120d7e1f34ec24ac9
tree0a521bc53e682b7ecec1aab5519b983d02a503c4
parentad08baa5c27ab063596116a178ccff7d3796df65
Add TF_TryEvaluateConstant to the C API and have smart_cond call it.

This effectively plumbs EvaluateConstantTensor to smart_cond. This makes smart_cond even smarter by trying to evaluate the predicate
if it can't statically infer it.

PiperOrigin-RevId: 188073244
tensorflow/c/c_api.cc
tensorflow/c/c_api.h
tensorflow/python/client/tf_session.i
tensorflow/python/client/tf_session_helper.cc
tensorflow/python/client/tf_session_helper.h
tensorflow/python/framework/smart_cond.py
tensorflow/python/framework/smart_cond_test.py