Skip to content

Allow defining an OpFromGraph from constant and shared inputs #676

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

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Mar 20, 2024

Also adds a strict flag

Description

This changes make working with OpFromGraph much simpler, as we can fully control the signature of OpFromGraph without having to worry whether the variables we are using to define the inner graph are shared/constants.

This facilitates the work being done in pymc-devs/pymc#6947

Related Issue

Checklist

Type of change

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

@ricardoV94 ricardoV94 changed the title Allow defining an OpFromGraph from constant and shared inputs. Allow defining an OpFromGraph from constant and shared inputs Mar 20, 2024
@ricardoV94 ricardoV94 force-pushed the allow_shared_constant_inputs_ofg branch from df050c8 to 8ca9ed5 Compare March 22, 2024 12:15
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.83%. Comparing base (339aab4) to head (8ca9ed5).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #676   +/-   ##
=======================================
  Coverage   80.83%   80.83%           
=======================================
  Files         162      162           
  Lines       46830    46830           
  Branches    11446    11447    +1     
=======================================
  Hits        37857    37857           
  Misses       6710     6710           
  Partials     2263     2263           
Files Coverage Δ
pytensor/compile/builders.py 77.17% <100.00%> (ø)

@ricardoV94 ricardoV94 merged commit 97317a5 into pymc-devs:main Mar 22, 2024
@ricardoV94 ricardoV94 mentioned this pull request Apr 9, 2024
11 tasks
@ricardoV94 ricardoV94 deleted the allow_shared_constant_inputs_ofg branch December 29, 2024 20:15
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.

OpFromGraph difficult to subclass due to not allowing shared variables to be positioned explicitly as an input
3 participants