Consider the following tensorflow python code:
a, b = tf.constant(1, tf.float32), tf.constant(2, tf.float32)
x = tf.placeholder(tf.float32, ())
y = a * x + b
print(tf.Session().run(y, {x: 2}))
In this case, I was well aware that in order for the run to work, I need to feed the placeholder {x: 2}.
But what if I wasn't aware of what placeholders are required (probably because the graph is too complicated, or because it is hidden away in someone's function)?
In such a situation, is it possible to dynamically obtain the list of feeds required to evaluate y?
I am hoping for something like:
print(tf.feeds(y)) # [<tf.Tensor 'x:0' shape=() dtype=float32>]
# Or:
print(y.feeds()) # [<tf.Tensor 'x:0' shape=() dtype=float32>]