@staticmethod
    def _gpu_matrix_dot(matrix_a, matrix_b, matrix_c=None):
        if not hasattr(ZCA._gpu_matrix_dot, 'theano_func'):
            ma, mb = theano.tensor.matrices('A', 'B')
            mc = theano.tensor.dot(ma, mb)
            ZCA._gpu_matrix_dot.theano_func = \
                theano.function([ma, mb], mc, allow_input_downcast=True)

        theano_func = ZCA._gpu_matrix_dot.theano_func

        try:
            if matrix_c is None:
                return theano_func(matrix_a, matrix_b)
            else:
                matrix_c[...] = theano_func(matrix_a, matrix_b)
                return matrix_c
        except MemoryError:
            warnings.warn('Matrix multiplication too big to fit on GPU. '
                          'Re-doing with CPU. Consider using '
                          'THEANO_FLAGS="device=cpu" for your next '
                          'preprocessor run')
            return numpy.dot(matrix_a, matrix_b, matrix_c)
Read a graph from JIT JSON.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/datasets/preprocessing.py/ZCA._gpu_matrix_dot--crossover with--dataset/ETHPy150Open networkx/networkx/networkx/readwrite/json_graph/jit.py/jit_graph