#NEWLINE# def batches( self ) : #NEWLINE# #INDENT# x1 = ca . empty ( self . x_shape , dtype = self . x . dtype ) #NEWLINE# x2 = ca . empty_like ( x1 ) #NEWLINE# y = ca . empty ( self . y_shape , dtype = self . y . dtype ) #NEWLINE# for ( start , stop ) in self . _batch_slices ( ) : #NEWLINE# #INDENT# if ( stop > start ) : #NEWLINE# #INDENT# x1_np = self . x [ start : stop ] #NEWLINE# x2_np = self . x2 [ start : stop ] #NEWLINE# y_np = self . y [ start : stop ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# x1_np = np . concatenate ( ( self . x [ start : ] , self . x [ : stop ] ) ) #NEWLINE# x2_np = np . concatenate ( ( self . x [ start : ] , self . x [ : stop ] ) ) #NEWLINE# y_np = np . concatenate ( ( self . y [ start : ] , self . y [ : stop ] ) ) #NEWLINE# #UNINDENT# ca . copyto ( x1 , x1_np ) #NEWLINE# ca . copyto ( x2 , x2_np ) #NEWLINE# ca . copyto ( y , y_np ) #NEWLINE# ( yield ( x1 , x2 , y ) )