Skip to content

Commit

Permalink
fixed mult being made as a local variable instead of referencing mdp.…
Browse files Browse the repository at this point in the history
…utils.mult
  • Loading branch information
npyoung committed Jun 27, 2013
1 parent a2ec28d commit bb64017
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mdp/gpu/gpu_extension.py
Expand Up @@ -6,13 +6,13 @@
"""
__docformat__="restructuredtext en"

from ..utils import mult
import mdp.utils
from ..extension import ExtensionNode, activate_extension, deactivate_extension
from theano import function
import theano.tensor as T

# Save the default dot product behavior
standard_mult = mult
standard_mult = mdp.utils.mult
# Declare theano symbolic variables and function
a, b = T.matrices('a','b')
gpu_mult = function([a,b], T.dot(a,b),allow_input_downcast=True)
Expand All @@ -23,12 +23,12 @@ def activate_gpu():
Swaps in a Theano-enabled GPU dot product instead of numx.dot for utils.mult.
"""

mult = gpu_mult
mdp.utils.mult = gpu_mult
#activate_extension('gpu')

def deactivate_gpu():
"""De-activate gpu extension."""
mult = standard_mult
mdp.utils.mult = standard_mult
#deactivate_extension('gpu')

class gpuify(object):
Expand Down

0 comments on commit bb64017

Please sign in to comment.