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

Torch add invert and split #1112

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ch0ronomato
Copy link
Contributor

@Ch0ronomato Ch0ronomato commented Dec 8, 2024

Description

These ops were needed to verify the pymc model in #1110

Related Issue

Checklist

Type of change

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

📚 Documentation preview 📚: https://pytensor--1112.org.readthedocs.build/en/1112/

@Ch0ronomato Ch0ronomato self-assigned this Dec 8, 2024
@Ch0ronomato Ch0ronomato added torch PyTorch backend enhancement New feature or request labels Dec 8, 2024
@Ch0ronomato
Copy link
Contributor Author

These are missing tests; will add a small one soon ™️

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 82.10%. Comparing base (07bd48d) to head (7a29d78).

Files with missing lines Patch % Lines
pytensor/link/pytorch/dispatch/basic.py 40.00% 3 Missing ⚠️
pytensor/link/pytorch/dispatch/scalar.py 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1112      +/-   ##
==========================================
- Coverage   82.10%   82.10%   -0.01%     
==========================================
  Files         185      185              
  Lines       48089    48097       +8     
  Branches     8659     8659              
==========================================
+ Hits        39485    39489       +4     
- Misses       6439     6443       +4     
  Partials     2165     2165              
Files with missing lines Coverage Δ
pytensor/link/pytorch/dispatch/scalar.py 71.42% <66.66%> (-0.45%) ⬇️
pytensor/link/pytorch/dispatch/basic.py 92.10% <40.00%> (-2.40%) ⬇️


@pytorch_funcify.register(Split)
def pytorch_funcify_Split(op, node, **kwargs):
def inner_fn(x, dim, split_amounts):
Copy link
Member

Choose a reason for hiding this comment

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

A more descriptive name is nice because it shows in the compiled function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea your totally right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request torch PyTorch backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants