-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bump PyTensor and support numpy>2.0 and Python 3.13 #7688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+83
−95
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e16ea09
Remove h5py conda dependency
ricardoV94 5e580fa
Remove m2w64-toolchain windows conda dependency
ricardoV94 e1823cb
Remove PolyaGamma pin and add to conda env
ricardoV94 1e768b7
Replace arange by range for iteration
ricardoV94 6b49b29
Fix __bool__ usages with PyTensor variables
ricardoV94 04c4346
Chaining classmethod and property no longer supported in Python 3.13
ricardoV94 d69b985
More precise type-hints
ricardoV94 2772464
Mypy doesn't believe you can call max on numpy arrays
ricardoV94 be342ff
Bump PyTensor and support Numpy>2.0 and Python=3.13
ricardoV94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,7 +369,7 @@ def get_support_shape( | |
support_shape_offset = [0] * ndim_supp | ||
elif isinstance(support_shape_offset, int): | ||
support_shape_offset = [support_shape_offset] * ndim_supp | ||
inferred_support_shape: Sequence[int | np.ndarray | Variable] | None = None | ||
inferred_support_shape: Sequence[int | np.ndarray | TensorVariable] | None = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mypy complains correctly that |
||
|
||
if shape is not None: | ||
shape = to_tuple(shape) | ||
|
@@ -378,9 +378,7 @@ def get_support_shape( | |
raise ValueError( | ||
f"Number of shape dimensions is too small for ndim_supp of {ndim_supp}" | ||
) | ||
inferred_support_shape = [ | ||
shape[i] - support_shape_offset[i] for i in np.arange(-ndim_supp, 0) | ||
] | ||
inferred_support_shape = [shape[i] - support_shape_offset[i] for i in range(-ndim_supp, 0)] | ||
|
||
if inferred_support_shape is None and dims is not None: | ||
dims = convert_dims(dims) | ||
|
@@ -389,7 +387,7 @@ def get_support_shape( | |
raise ValueError(f"Number of dims is too small for ndim_supp of {ndim_supp}") | ||
model = modelcontext(None) | ||
inferred_support_shape = [ | ||
model.dim_lengths[dims[i]] - support_shape_offset[i] for i in np.arange(-ndim_supp, 0) | ||
model.dim_lengths[dims[i]] - support_shape_offset[i] for i in range(-ndim_supp, 0) | ||
] | ||
|
||
if inferred_support_shape is None and observed is not None: | ||
|
@@ -399,7 +397,7 @@ def get_support_shape( | |
f"Number of observed dimensions is too small for ndim_supp of {ndim_supp}" | ||
) | ||
inferred_support_shape = [ | ||
observed.shape[i] - support_shape_offset[i] for i in np.arange(-ndim_supp, 0) | ||
observed.shape[i] - support_shape_offset[i] for i in range(-ndim_supp, 0) | ||
] | ||
|
||
if inferred_support_shape is None: | ||
|
@@ -413,7 +411,7 @@ def get_support_shape( | |
# There were two sources of support_shape, make sure they are consistent | ||
inferred_support_shape = [ | ||
cast( | ||
Variable, | ||
TensorVariable, | ||
Assert(msg="support_shape does not match respective shape dimension")( | ||
inferred, pt.eq(inferred, explicit) | ||
), | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 3.13 stopped allowing chaining property and classmethods