<s> """<STR_LIT>""" <EOL> import theano <EOL> from theano . gof import Constant <EOL> from theano . tensor . type_other import MakeSlice , make_slice , NoneTypeT , NoneConst <EOL> def test_make_slice_merge ( ) : <EOL> i = theano . tensor . iscalar ( ) <EOL> s1 = make_slice ( <NUM_LIT:0> , i ) <EOL> s2 = make_slice ( <NUM_LIT:0> , i ) <EOL> f = theano . function ( [ i ] , [ s1 , s2 ] ) <EOL> nodes = f . maker . fgraph . apply_nodes <EOL> assert len ( [ n for n in nodes if isinstance ( n . op , MakeSlice ) ] ) == <NUM_LIT:1> <EOL> theano . printing . debugprint ( f ) <EOL> def test_none_Constant ( ) : <EOL> """<STR_LIT>""" <EOL> o1 = Constant ( NoneTypeT ( ) , None , name = '<STR_LIT>' ) <EOL> o2 = Constant ( NoneTypeT ( ) , None , name = '<STR_LIT>' ) <EOL> assert o1 . equals ( o2 ) <EOL> assert NoneConst . equals ( o1 ) <EOL> assert o1 . equals ( NoneConst ) <EOL> assert NoneConst . equals ( o2 ) <EOL> assert o2 . equals ( NoneConst ) <EOL> import six . moves . cPickle as pickle <EOL> import theano <EOL> from theano import tensor <EOL> x = tensor . vector ( '<STR_LIT:x>' ) <EOL> y = tensor . argmax ( x ) <EOL> kwargs = { } <EOL> if theano . config . mode in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> kwargs = { '<STR_LIT>' : '<STR_LIT>' } <EOL> f = theano . function ( [ x ] , [ y ] , ** kwargs ) <EOL> pickle . loads ( pickle . dumps ( f ) ) </s>
