• Brendan Murphy's avatar
    Make complex scalars work with numpy 2.0 · 756be77e
    Brendan Murphy 提交于
    This is done using C++ generic functions
    to get/set the real/imag parts of complex numbers.
    
    This gives us an easy way to support Numpy v < 2.0,
    and allows the type underlying the bit width types,
    like pytensor_complex128, to be correctly inferred
    from the numpy complex types they inherit from.
    
    Updated pytensor_complex struct to use get/set real/imag
    aliases defined above. Also updated operators such as
    `Abs` to use get_real, get_imag.
    
    Macros have been added to ensure compatibility with numpy < 2.0
    
    Note: redefining the complex arithmetic here means that we
    aren't treating NaNs and infinities as carefully as the C99
    standard suggets (see Appendix G of the standard).
    
    The code has been like this since it was added to Theano,
    so we're keeping the existing behavior.
    756be77e
名称
最后提交
最后更新
.github 正在载入提交数据...
doc 正在载入提交数据...
pytensor 正在载入提交数据...
scripts 正在载入提交数据...
tests 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.pre-commit-config.yaml 正在载入提交数据...
.readthedocs.yaml 正在载入提交数据...
CODE_OF_CONDUCT.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
GOVERNANCE.md 正在载入提交数据...
LICENSE.txt 正在载入提交数据...
MANIFEST.in 正在载入提交数据...
README.rst 正在载入提交数据...
codecov.yml 正在载入提交数据...
conftest.py 正在载入提交数据...
environment-osx-arm64.yml 正在载入提交数据...
environment.yml 正在载入提交数据...
pyproject.toml 正在载入提交数据...
setup.py 正在载入提交数据...