示例#1
0
def test_sample_discrete_python2():
    # Specified rand number
    d = dit.example_dists.Xor()
    x = module._samples_discrete__python(d.pmf, np.array([.5, .3, .2]))
    assert np.allclose(x, np.array([2, 1, 0]))
示例#2
0
def test_sample_discrete_python3():
    # Specified rand number
    d = dit.example_dists.Xor()
    out = np.zeros((3, ))
    module._samples_discrete__python(d.pmf, np.array([.5, .3, .2]), out=out)
    assert np.allclose(out, np.array([2, 1, 0]))
示例#3
0
def test_sample_discrete_python2():
    # Specified rand number
    d = dit.example_dists.Xor()
    x = module._samples_discrete__python(d.pmf, np.array([.5, .3, .2]))
    np.testing.assert_allclose(x, np.array([2, 1, 0]))