def shared_dataset(data_xy, borrow=True):
 (data_x, data_y) = data_xy
 shared_x = theano.shared(np.asarray(data_x, dtype=theano.config.floatX), borrow=borrow)
 shared_y = theano.shared(np.asarray(data_y, dtype=theano.config.floatX), borrow=borrow)
 return (shared_x, T.cast(shared_y, 'int32'))

def shared_dataset ( data_xy , borrow = True ) : ( data_x , data_y ) = data_xy shared_x = theano . shared ( np . asarray ( data_x , dtype = theano . config . floatX ) , borrow = borrow ) shared_y = theano . shared ( np . asarray ( data_y , dtype = theano . config . floatX ) , borrow = borrow ) return ( shared_x , T . cast ( shared_y , 'int32' ) )
function that loads the dataset into shared variables the reason we store our dataset in shared variables is to allow theano to copy it into the gpu memory .