def test_update_var_arr(): d = np.zeros((5, 5, 5, 10)) mvn = MVN(d) for param in range(3): img = np.random.rand(5, 5, 5) mvn.update(param, var=img) assert np.all(mvn[..., mvn.var_index(param)] == img)
def test_update_var_const(): d = np.zeros((5, 5, 5, 10)) mvn = MVN(d) for param in range(3): mvn.update(param, var=float(param + 1)) for param in range(3): assert np.all(mvn[..., mvn.var_index(param)] == float(param + 1))