def test_get_set_vector():
 rng = np.random.RandomState([2014, 5, 8])
 class DummyModel(Model, ):
  "\n        A Model that exercises this test by having a few different\n        parameters with different shapes and dimensionalities.\n\n        Don't instantiate more than one of these because the parameters\n        are class-level attributes.\n        "
  _params = [sharedX(rng.randn(5)), sharedX(rng.randn(5, 3)), sharedX(rng.randn(4, 4, 4))]
 model = DummyModel()
 vector = model.get_param_vector()
 model.set_param_vector((0.0 * vector))
 assert np.allclose((0.0 * vector), model.get_param_vector())
 model.set_param_vector(vector)
 assert np.allclose(model.get_param_vector(), vector)

def test_get_set_vector ( ) : rng = np . random . RandomState ( [ 2014 , 5 , 8 ] ) class DummyModel ( Model , ) : _params = [ sharedX ( rng . randn ( 5 ) ) , sharedX ( rng . randn ( 5 , 3 ) ) , sharedX ( rng . randn ( 4 , 4 , 4 ) ) ] model = DummyModel ( ) vector = model . get_param_vector ( ) model . set_param_vector ( ( 0.0 * vector ) ) assert np . allclose ( ( 0.0 * vector ) , model . get_param_vector ( ) ) model . set_param_vector ( vector ) assert np . allclose ( model . get_param_vector ( ) , vector )
tests that get_vector and set_vector use the same format .