In ipython I imported tensorflow as tf
and numpy as np
and created an TensorFlow InteractiveSession
.
When I am running or initializing some normal distribution with numpy input, everything runs fine:
some_test = tf.constant(np.random.normal(loc=0.0, scale=1.0, size=(2, 2)))
session.run(some_test)
Returns:
array([[-0.04152317, 0.19786302],
[-0.68232622, -0.23439092]])
Just as expected.
...but when I use the Tensorflow normal distribution function:
some_test = tf.constant(tf.random_normal([2, 2], mean=0.0, stddev=1.0, dtype=tf.float32))
session.run(some_test)
...it raises a Type error saying:
(...)
TypeError: List of Tensors when single Tensor expected
What am I missing here?
The output of:
sess.run(tf.random_normal([2, 2], mean=0.0, stddev=1.0, dtype=tf.float32))
alone returns the exact same thing which np.random.normal
generates -> a matrix of shape (2, 2)
with values taken from a normal distribution.