예제 #1
0
 def test_gaussian_vector(self):
     mut.GaussianVectorX()
     mut.GaussianVectorX([-0.5, 0.5], [0.2, 0.2])
     dut = mut.GaussianVectorX(mean=[-1.0, 1.0], stddev=[0.1, 0.1])
     dut.mean = [-2.0, 2.0]
     dut.stddev = [0.2, 0.2]
     self._check_distribution_vector(dut)
예제 #2
0
 def test_distribution_vector_variant(self):
     """Confirms that the free functions that operate on a vector variant
     are bound."""
     items = [
         mut.DeterministicVectorX(value=[1.0]),
         mut.GaussianVectorX(mean=[1.0], stddev=[0.1]),
         mut.UniformVectorX(min=[-1.0], max=[1.0]),
     ]
     for item in items:
         copied = mut.ToDistributionVector(item)
         self._check_distribution_vector(copied)
         if mut.IsDeterministic(vec=item):
             mut.GetDeterministicValue(vec=item)