

def test_random(self):
    '\n        Test random sampling of beta nodes.\n        '
    p = Beta([1e+20, 3e+20])
    x = p.random()
    self.assertAllClose(x, 0.25)
    p = Beta([[1e+20, 3e+20], [1e+20, 1e+20]])
    x = p.random()
    self.assertAllClose(p, [0.25, 0.5])
    p = Beta([1e+20, 3e+20], plates=(3,))
    x = p.random()
    self.assertAllClose(x, [0.25, 0.25, 0.25])
    pass

dataset/ETHPy150Open bayespy/bayespy/bayespy/inference/vmp/nodes/tests/test_beta.py TestBeta.test_random/VarMisuse@71/108 `x`->`p`