#NEWLINE# def test_softmax( self ) : #NEWLINE# #INDENT# if ( not dnn . dnn_available ( test_ctx_name ) ) : #NEWLINE# #INDENT# raise SkipTest ( dnn . dnn_available . msg ) #NEWLINE# #UNINDENT# t = T . ftensor4 ( 't' ) #NEWLINE# rand_tensor = numpy . asarray ( numpy . random . rand ( 5 , 4 , 3 , 2 ) , dtype = 'float32' ) #NEWLINE# self . _compile_and_check ( [ t ] , [ dnn . GpuDnnSoftmax ( 'accurate' , 'channel' ) ( t ) ] , [ rand_tensor ] , dnn . GpuDnnSoftmax ) #NEWLINE# self . _compile_and_check ( [ t ] , [ T . grad ( dnn . GpuDnnSoftmax ( 'accurate' , 'channel' ) ( t ) . mean ( ) , t ) ] , [ rand_tensor ] , dnn . GpuDnnSoftmaxGrad )