@staticmethod
    def _gpu_mdmt(mat, diags):

        floatX = theano.config.floatX

        # compile theano function
        if not hasattr(ZCA._gpu_mdmt, 'theano_func'):
            t_mat = T.matrix('M')
            t_diags = T.vector('D')
            result = T.dot(t_mat * t_diags, t_mat.T)
            ZCA._gpu_mdmt.theano_func = theano.function(
                [t_mat, t_diags],
                result,
                allow_input_downcast=True)

        try:
            # function()-call above had to downcast the data. Emit warnings.
            if str(mat.dtype) != floatX:
                warnings.warn('Implicitly converting mat from dtype=%s to '
                              '%s for gpu' % (mat.dtype, floatX))
            if str(diags.dtype) != floatX:
                warnings.warn('Implicitly converting diag from dtype=%s to '
                              '%s for gpu' % (diags.dtype, floatX))

            return ZCA._gpu_mdmt.theano_func(mat, diags)

        except MemoryError:
            # fall back to cpu
            warnings.warn('M * D * M^T was too big to fit on GPU. '
                          'Re-doing with CPU. Consider using '
                          'THEANO_FLAGS="device=cpu" for your next '
                          'preprocessor run')
            return np.dot(mat * diags, mat.T)
Return a day as a table cell.
dataset/ETHPy150Open hycis/Mozi/mozi/datasets/preprocessor.py/ZCA._gpu_mdmt--crossover with--dataset/ETHPy150Open wreckage/django-happenings/happenings/utils/calendars.py/MiniEventCalendar.formatday