-
Notifications
You must be signed in to change notification settings - Fork 4
wrap more functions to complete a minimal viable feature set #65
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
00d78c4
to
6ba8cfb
Compare
No longer WIP, ready for review. |
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.
All the complex max/min/argmax/argmin... we may be able to implement them via casting the complex tensor to a real one via view_as_real
. Now, I think it's pretty low prio, as IMO, these should not even work.
# For more than d=2, the strided formula is only valid for arrays with | ||
# all dimensions equal, so we check first. | ||
s = tensor.shape | ||
if s[1:] != s[:-1]: |
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.
Rather slick ngl.
Review comments addressed, other than those I'd rather do in a sequel |
def diagonal(tensor, offset=0, axis1=0, axis2=1): | ||
axis1 = _util.normalize_axis_index(axis1, tensor.ndim) | ||
axis2 = _util.normalize_axis_index(axis2, tensor.ndim) | ||
result = torch.diagonal(tensor, offset, axis1, axis2) | ||
return result |
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.
My point was that this could simply be
def diagonal(tensor, offset=0, axis1=0, axis2=1): | |
axis1 = _util.normalize_axis_index(axis1, tensor.ndim) | |
axis2 = _util.normalize_axis_index(axis2, tensor.ndim) | |
result = torch.diagonal(tensor, offset, axis1, axis2) | |
return result | |
def diagonal(tensor, offset=0, axis1=0, axis2=1): | |
return torch.diagonal(tensor, offset, axis1, axis2) |
No need to change it really.
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.
Ah, great. Made a note to self to go through normalize_axis_index
invocations across the codebase.
Thanks Mario for the review! |
Only
are left for a tentative minimum viable functionality set.