#NEWLINE# def test_Strides3D( self ) : #NEWLINE# #INDENT# x = T . ftensor3 ( 'x' ) #NEWLINE# for axis in [ 0 , 1 , 2 , None , ( - 1 ) , ( - 2 ) , ( - 3 ) ] : #NEWLINE# #INDENT# a = np . random . random ( ( 42 , 30 , 25 ) ) . astype ( 'float32' ) #NEWLINE# cumsum_function = theano . function ( [ x ] , cumsum ( x , axis = axis ) , mode = self . mode ) #NEWLINE# slicings = [ slice ( None , None , None ) , slice ( None , None , 2 ) , slice ( None , None , ( - 1 ) ) ] #NEWLINE# for slicing in itertools . product ( slicings , repeat = x . ndim ) : #NEWLINE# #INDENT# f = theano . function ( [ x ] , cumsum ( x [ slicing ] , axis = axis ) , mode = self . mode ) #NEWLINE# assert [ n for n in f . maker . fgraph . toposort ( ) if isinstance ( n . op , GpuCumsum ) ] #NEWLINE# utt . assert_allclose ( np . cumsum ( a [ slicing ] , axis = axis ) , f ( a ) ) #NEWLINE# utt . assert_allclose ( np . cumsum ( a [ slicing ] , axis = axis ) , cumsum_function ( a [ slicing ] ) )