Skip to content
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

Cleanup Max and Argmax #901

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Conversation

ricardoV94
Copy link
Member

Description

Spinoff from #888 and follow up to #731

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments, looks good to me

pytensor/tensor/math.py Outdated Show resolved Hide resolved
pytensor/tensor/math.py Show resolved Hide resolved
out = makeKeepDims(a, out, axis)
argout = makeKeepDims(a, argout, axis)
return [out, argout]
return [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need max_and_argmax? I thought the original reason for it was because the two operations were originally fused somehow, so when you asked for one you got the other one "for free". Seems like they are fully separate now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, now the function is just a backwards compat tiny wrapper

pytensor/tensor/math.py Outdated Show resolved Hide resolved
@@ -1220,6 +1220,20 @@ class CAReduce(COp):

__props__ = ("scalar_op", "axis", "dtype", "acc_dtype", "upcast_discrete_output")

@classmethod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks more like a staticmethod

Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.

Project coverage is 81.24%. Comparing base (9ba6d99) to head (6cb0302).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #901   +/-   ##
=======================================
  Coverage   81.23%   81.24%           
=======================================
  Files         170      170           
  Lines       47008    46920   -88     
  Branches    11516    11482   -34     
=======================================
- Hits        38187    38120   -67     
+ Misses       6612     6600   -12     
+ Partials     2209     2200    -9     
Files Coverage Δ
pytensor/tensor/elemwise.py 88.33% <100.00%> (-0.09%) ⬇️
pytensor/tensor/rewriting/linalg.py 91.47% <ø> (+1.61%) ⬆️
pytensor/tensor/math.py 91.27% <88.88%> (+0.69%) ⬆️

... and 3 files with indirect coverage changes

@ricardoV94 ricardoV94 changed the title Cleanup Max and Arrgmax Cleanup Max and Argmax Jul 8, 2024
@ricardoV94 ricardoV94 force-pushed the cleanup_max_argmax branch 3 times, most recently from d1b0d8a to 0f87a69 Compare July 8, 2024 12:24
@ricardoV94 ricardoV94 merged commit 8e0958a into pymc-devs:main Jul 8, 2024
58 of 59 checks passed
@ricardoV94 ricardoV94 removed the request for review from Dhruvanshu-Joshi July 8, 2024 14:24
@ricardoV94 ricardoV94 deleted the cleanup_max_argmax branch July 8, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants