#NEWLINE# @ attr ( 'slow' ) #NEWLINE# def test_infer_shape( self ) : #NEWLINE# #INDENT# for dtype in tensor . discrete_dtypes : #NEWLINE# #INDENT# int_bitwidth = theano . configdefaults . python_int_bitwidth ( ) #NEWLINE# if ( int_bitwidth == 64 ) : #NEWLINE# #INDENT# numpy_unsupported_dtypes = ( 'uint64' , ) #NEWLINE# #UNINDENT# if ( int_bitwidth == 32 ) : #NEWLINE# #INDENT# numpy_unsupported_dtypes = ( 'uint32' , 'int64' , 'uint64' ) #NEWLINE# #UNINDENT# x = T . vector ( 'x' , dtype = dtype ) #NEWLINE# if ( dtype in numpy_unsupported_dtypes ) : #NEWLINE# #INDENT# self . assertRaises ( TypeError , BinCountOp ( ) , x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _compile_and_check ( [ x ] , [ BinCountOp ( ) ( x , None ) ] , [ np . random . random_integers ( 50 , size = ( 25 , ) ) . astype ( dtype ) ] , self . op_class ) #NEWLINE# weights = np . random . random ( ( 25 , ) ) . astype ( config . floatX ) #NEWLINE# self . _compile_and_check ( [ x ] , [ BinCountOp ( ) ( x , weights = weights ) ] , [ np . random . random_integers ( 50 , size = ( 25 , ) ) . astype ( dtype ) ] , self . op_class ) #NEWLINE# if ( not numpy_16 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# self . _compile_and_check ( [ x ] , [ BinCountOp ( minlength = 60 ) ( x , weights = weights ) ] , [ np . random . random_integers ( 50 , size = ( 25 , ) ) . astype ( dtype ) ] , dtype . op_class ) #NEWLINE# self . _compile_and_check ( [ x ] , [ BinCountOp ( minlength = 5 ) ( x , weights = weights ) ] , [ np . random . random_integers ( 50 , size = ( 25 , ) ) . astype ( dtype ) ] , self . op_class )