#NEWLINE# def test_inplace_optimization( self ) : #NEWLINE# #INDENT# 'Test that FAST_RUN includes the random_make_inplace optimization' #NEWLINE# rf2 = RandomFunction ( numpy . random . RandomState . uniform , tensor . dvector ) #NEWLINE# rng_R = random_state_type ( ) #NEWLINE# ( post_r2 , out2 ) = rf2 ( rng_R , ( 4 , ) , 0.0 , 1.0 ) #NEWLINE# f = compile . function ( [ compile . In ( rng_R , value = numpy . random . RandomState ( utt . fetch_seed ( ) ) , update = post_r2 , mutable = True ) ] , out2 , mode = 'FAST_RUN' ) #NEWLINE# id0 = id ( f [ rng_R ] ) #NEWLINE# val0 = f ( ) #NEWLINE# assert ( id0 == id ( f [ rng_R ] ) ) #NEWLINE# val1 = f ( ) #NEWLINE# assert ( id0 == id ( f [ rng_R ] ) ) #NEWLINE# assert ( not numpy . allclose ( val0 , val1 ) )