#NEWLINE# @ local_optimizer ( [ GpuConv ] ) #NEWLINE# def local_conv_dnn( node ) : #NEWLINE# #INDENT# if ( not dnn_available ( ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if isinstance ( node . op , GpuConv ) : #NEWLINE# #INDENT# if ( node . op . border_mode not in [ 'full' , 'valid' ] ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# ( img , kern ) = node . inputs #NEWLINE# border_mode = node . op . border_mode #NEWLINE# subsample = node . op . subsample #NEWLINE# direction_hint = node . op . direction_hint #NEWLINE# rval = dnn_conv ( img , kern , border_mode = border_mode , subsample = subsample , direction_hint = direction_hint ) #NEWLINE# if ( node . outputs [ 0 ] . broadcastable != rval . broadcastable ) : #NEWLINE# #INDENT# rval = tensor . patternbroadcast ( rval , node . outputs [ 0 ] . type . broadcastable ) #NEWLINE# #UNINDENT# return [ img ]