theano/sandbox/rng_mrg.py
def multMatVect(v, A, m1, B, m2):
    # TODO : need description for parameter and return
    """
    Multiply the first half of v by A with a modulo of m1 and the second half
    by B with a modulo of m2.

    Notes
    -----
    The parameters of dot_modulo are passed implicitly because passing them
    explicitly takes more time than running the function's C-code.

    """
    if multMatVect.dot_modulo is None:
        A_sym = tensor.lmatrix('A')
        s_sym = tensor.ivector('s')
        m_sym = tensor.iscalar('m')
        A2_sym = tensor.lmatrix('A2')
        s2_sym = tensor.ivector('s2')
        m2_sym = tensor.iscalar('m2')
        o = DotModulo()(A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym)
        multMatVect.dot_modulo = function(
            [A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym], o, profile=False)

    # This way of calling the Theano fct is done to bypass Theano overhead.
    f = multMatVect.dot_modulo
    f.input_storage[0].storage[0] = A
    f.input_storage[1].storage[0] = v[:3]
    f.input_storage[2].storage[0] = m1
    f.input_storage[3].storage[0] = B
    f.input_storage[4].storage[0] = v[3:]
    f.input_storage[5].storage[0] = m2
    f.fn()
    r = f.output_storage[0].storage[0]

    return r

    Multiply the first half of v by A with a modulo of m1 and the second half
    by B with a modulo of m2.

    Notes
    -----
    The parameters of dot_modulo are passed implicitly because passing them
    explicitly takes more time than running the function's C-code.

    
Multiply the first half of v by A with a modulo of m1 and the second half
by B with a modulo of m2.

Notes

The parameters of dot_modulo are passed implicitly because passing them
explicitly takes more time than running the function's C-code.
Multiply the first half of v by A with a modulo of m1 and the second half by B with a modulo of m2 . Notes The parameters of dot_modulo are passed implicitly because passing them explicitly takes more time than running the function ' s C - code .
def multMatVect(v, A, m1, B, m2):
    if multMatVect.dot_modulo is None:
        A_sym = tensor.lmatrix('A')
        s_sym = tensor.ivector('s')
        m_sym = tensor.iscalar('m')
        A2_sym = tensor.lmatrix('A2')
        s2_sym = tensor.ivector('s2')
        m2_sym = tensor.iscalar('m2')
        o = DotModulo()(A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym)
        multMatVect.dot_modulo = function(
            [A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym], o, profile=False)
    f = multMatVect.dot_modulo
    f.input_storage[0].storage[0] = A
    f.input_storage[1].storage[0] = v[:3]
    f.input_storage[2].storage[0] = m1
    f.input_storage[3].storage[0] = B
    f.input_storage[4].storage[0] = v[3:]
    f.input_storage[5].storage[0] = m2
    f.fn()
    r = f.output_storage[0].storage[0]
    return r
def multMatVect ( v , A , m1 , B , m2 ) : if multMatVect . dot_modulo is None : A_sym = tensor . lmatrix ( 'A' ) s_sym = tensor . ivector ( 's' ) m_sym = tensor . iscalar ( 'm' ) A2_sym = tensor . lmatrix ( 'A2' ) s2_sym = tensor . ivector ( 's2' ) m2_sym = tensor . iscalar ( 'm2' ) o = DotModulo ( ) ( A_sym , s_sym , m_sym , A2_sym , s2_sym , m2_sym ) multMatVect . dot_modulo = function ( [ A_sym , s_sym , m_sym , A2_sym , s2_sym , m2_sym ] , o , profile = False ) f = multMatVect . dot_modulo f . input_storage [ 0 ] . storage [ 0 ] = A f . input_storage [ 1 ] . storage [ 0 ] = v [ : 3 ] f . input_storage [ 2 ] . storage [ 0 ] = m1 f . input_storage [ 3 ] . storage [ 0 ] = B f . input_storage [ 4 ] . storage [ 0 ] = v [ 3 : ] f . input_storage [ 5 ] . storage [ 0 ] = m2 f . fn ( ) r = f . output_storage [ 0 ] . storage [ 0 ] return r
Multiply the first half of v by A with a modulo of m1 and the second half
by B with a modulo of m2.
Multiply the first half of v by A with a modulo of m1 and the second half by B with a modulo of m2 .
# TODO : need description for parameter and return """
    Multiply the first half of v by A with a modulo of m1 and the second half
    by B with a modulo of m2.

    Notes
    -----
    The parameters of dot_modulo are passed implicitly because passing them
    explicitly takes more time than running the function's C-code.

    """ # This way of calling the Theano fct is done to bypass Theano overhead.
v
A
m1
B
m2