Skip to content

Commit

Permalink
Import deprecated scipy.linalg.triu from numpy.triu instead (#3524)
Browse files Browse the repository at this point in the history
* Removing Import of depecrated triu function imported from scipy lib

* Importing triu from numpy if failed falling back to scipy
  • Loading branch information
Luffy610 committed Apr 5, 2024
1 parent e7b441b commit ad68ee3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gensim/matutils.py
Expand Up @@ -17,9 +17,13 @@
import numpy as np
import scipy.sparse
from scipy.stats import entropy
from scipy.linalg import get_blas_funcs, triu
from scipy.linalg import get_blas_funcs
from scipy.linalg.lapack import get_lapack_funcs
from scipy.special import psi # gamma function utils
try:
from numpy import triu
except ImportError:
from scipy.linalg import triu


logger = logging.getLogger(__name__)
Expand Down

0 comments on commit ad68ee3

Please sign in to comment.