def test_dense_outputs(dense, make_data):
"""Make sure the dense layers output expected dimensions."""
x, _, _ = make_data
S = 3
x_, X_ = _make_placeholders(x, S)
N = x.shape[0]
Phi, KL = dense(output_dim=D)(X_)
tc = tf.test.TestCase()
with tc.test_session():
tf.global_variables_initializer().run()
P = Phi.eval(feed_dict={x_: x})
assert P.shape == (S, N, D)
assert P.dtype == np.float32
assert np.isscalar(KL.eval(feed_dict={x_: x}))
评论列表
文章目录