def test_batch_normalized_mlp_learn_shift_propagated_at_alloc():
 mlp = BatchNormalizedMLP([Tanh(), Tanh()], [5, 7, 9], learn_shift=False)
 assert (not mlp.learn_shift)
 assert all((act.children[0].learn_shift for act in mlp.activations))
 mlp.allocate()
 assert (not any((act.children[0].learn_shift for act in mlp.activations)))

def test_batch_normalized_mlp_learn_shift_propagated_at_alloc ( ) : mlp = BatchNormalizedMLP ( [ Tanh ( ) , Tanh ( ) ] , [ 5 , 7 , 9 ] , learn_shift = False ) assert ( not mlp . learn_shift ) assert all ( ( act . children [ 0 ] . learn_shift for act in mlp . activations ) ) mlp . allocate ( ) assert ( not any ( ( act . children [ 0 ] . learn_shift for act in mlp . activations ) ) )
test that setting learn_shift on a batchnormalizedmlp works .