Joe
Joe

Reputation: 909

How to find code source of scipy.special.rel_entr function?

I am trying to look for the code source of scipy.special.rel_entr function in GitHub Repo but could not find rel_entr function definition.

I also tried to look in this code: https://github.com/scipy/scipy/pull/6522/files#diff-0

Upvotes: 1

Views: 590

Answers (1)

Warren Weckesser
Warren Weckesser

Reputation: 114841

scipy.special.rel_entr is a ufunc. The core calculation that is used by the function is implemented in Cython in the file _convex_analysis.pxd, specifically these lines. All the wrapper code that implements the ufunc rel_entr is generated automatically when SciPy is built, based on configuration data in the file functions.json.

Upvotes: 6

Related Questions