#NEWLINE# def test_conv_grads( ) : #NEWLINE# #INDENT# if ( ( not cuda . dnn . dnn_available ( ) ) or ( cuda . device_properties ( cuda . active_device_number ( ) ) [ 'major' ] < 3 ) ) : #NEWLINE# #INDENT# ops = [ gemm_op ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ops = [ gemm_op , dnn_op ] #NEWLINE# #UNINDENT# for mode in ( 'valid' , 'full' ) : #NEWLINE# #INDENT# for bs in [ 1 , 5 ] : #NEWLINE# #INDENT# for ch in [ 4 ] : #NEWLINE# #INDENT# for nf in [ 3 ] : #NEWLINE# #INDENT# for rImg1 in [ 2 , 5 ] : #NEWLINE# #INDENT# for rImg2 in [ 2 , 8 ] : #NEWLINE# #INDENT# for rFlt1 in [ 1 , 2 ] : #NEWLINE# #INDENT# for rFlt2 in [ 1 , 2 ] : #NEWLINE# #INDENT# for subsample in ( ( 1 , 1 ) , ( 1 , 2 ) , ( 2 , 2 ) ) : #NEWLINE# #INDENT# for op in ops : #NEWLINE# #INDENT# ( yield ( conv_grad , mode , bs , ch , nf , rImg1 , bs , rFlt1 , rFlt2 , subsample , op ) )