-
Notifications
You must be signed in to change notification settings - Fork 132
Modify atleast_Nd
to accept only one positional argument
#1291
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1291 +/- ##
=======================================
Coverage 81.99% 82.00%
=======================================
Files 188 188
Lines 48553 48527 -26
Branches 8673 8667 -6
=======================================
- Hits 39812 39793 -19
+ Misses 6579 6578 -1
+ Partials 2162 2156 -6
🚀 New features to boost your workflow:
|
pytensor/tensor/basic.py
Outdated
@@ -4355,28 +4355,22 @@ def empty_like( | |||
|
|||
|
|||
def atleast_Nd( | |||
*arys: np.ndarray | TensorVariable, n: int = 1, left: bool = True | |||
arry: np.ndarray | TensorVariable, n: int = 1, left: bool = True |
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.
Just to avoid surprises, I would make it so you have to specify n explicitly like before. It simply doesn't accept multiple arrays anymore, so it won't be a silent change if someone was relying on this.
Later on we can allow n to be positional only like you did now.
arry: np.ndarray | TensorVariable, n: int = 1, left: bool = True | |
arry: np.ndarray | TensorVariable, *, n: int = 1, left: bool = True |
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.
I have made this change, modified the tests accordingly too
Thanks @Abhinav-Khot |
atleast_Nd
to accept only one positional argument
Description
Modified
atleast_Nd
to accept only one positional argument. Also modified the tests to account for this change.After the changes, in
atleast_Nd(x, 1)
,x
is interpreted as an array and 1 is interpreted as the dimension. This change is reflected in the tests too.Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pytensor--1291.org.readthedocs.build/en/1291/