test_univariate.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:zhusuan 作者: thu-ml 项目源码 文件源码
def test_init(self):
        with self.test_session(use_gpu=True):
            with self.assertRaisesRegexp(
                    ValueError, "Either.*should be passed but not both"):
                FoldNormal(mean=tf.ones([2, 1]))
            with self.assertRaisesRegexp(
                    ValueError, "Either.*should be passed but not both"):
                FoldNormal(mean=tf.ones([2, 1]), std=1., logstd=0.)
            with self.assertRaisesRegexp(ValueError,
                                         "should be broadcastable to match"):
                FoldNormal(mean=tf.ones([2, 1]), logstd=tf.zeros([2, 4, 3]))
            with self.assertRaisesRegexp(ValueError,
                                         "should be broadcastable to match"):
                FoldNormal(mean=tf.ones([2, 1]), std=tf.ones([2, 4, 3]))

        FoldNormal(mean=tf.placeholder(tf.float32, [None, 1]),
                   logstd=tf.placeholder(tf.float32, [None, 1, 3]))
        FoldNormal(mean=tf.placeholder(tf.float32, [None, 1]),
                   std=tf.placeholder(tf.float32, [None, 1, 3]))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号