Skip to content

Commit 4cc13bc

Browse files
committed
Add numpy constants to pytensor.tensor scope
1 parent 9ada945 commit 4cc13bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pytensor/tensor/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,8 @@ def _get_vector_length_Constant(op: Union[Op, Variable], var: Constant) -> int:
148148
from pytensor.tensor.type_other import * # noqa
149149
from pytensor.tensor.var import TensorConstant, TensorVariable # noqa
150150

151+
# Allow accessing numpy constants from pytensor.tensor
152+
from numpy import e, euler_gamma, inf, infty, nan, newaxis, pi # noqa
153+
151154

152155
__all__ = ["random"] # noqa: F405

0 commit comments

Comments
 (0)