Skip to content

Commit

Permalink
move it to its own module to avoid hound
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed Jul 7, 2019
1 parent 9c44cca commit 4a862b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 8 additions & 0 deletions convoys/autograd_scipy_monkeypatch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Monkey patching scipy to avoid issue with autograd
# Newest scipy moved logsumexp from scipy.misc to scipy.special
# This is fixed in latest autograd, but it's not on PyPI yet

import scipy.misc
if not hasattr(scipy.misc, 'logsumexp'):
import scipy.special
scipy.misc.logsumexp = scipy.special.logsumexp
8 changes: 1 addition & 7 deletions convoys/regression.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Monkey patching scipy to avoid issue with autograd
import scipy.misc
if not hasattr(scipy.misc, 'logsumexp'):
import scipy.special
scipy.misc.logsumexp = scipy.special.logsumexp

# Now, continue with the real stuff.
from convoys import autograd_scipy_monkeypatch
import autograd
from autograd_gamma import gammainc
import emcee
Expand Down

0 comments on commit 4a862b3

Please sign in to comment.