Usability improvement for tf.constant_initializer
authorShanqing Cai <cais@google.com>
Sun, 31 Dec 2017 05:25:36 +0000 (21:25 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Sun, 31 Dec 2017 05:28:44 +0000 (21:28 -0800)
commit2cdbdee8f4059f65e3dd7f96bb328f790df547f6
tree516500075091ae6689b75f042a8b94f090b04bc9
parent86caed273d290334a0ff52ab377ae91478cf62c8
Usability improvement for tf.constant_initializer

* Raise TypeError if the input value is not one of the expected types,
  e.g., a tf.Tensor. Previously, the error is delayed until Session.run()
  time and the message is very obscure, e.g.,
  "TypeError: Expected float32, got list containing Tensors of type
   '_Message' instead."

PiperOrigin-RevId: 180416775
tensorflow/python/BUILD
tensorflow/python/kernel_tests/init_ops_test.py
tensorflow/python/ops/init_ops.py