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

Strip control inputs from graph when creating new TF functions from tensors. #5

Merged
merged 8 commits into from
Jul 24, 2023

Conversation

psobot
Copy link
Member

@psobot psobot commented Jul 21, 2023

When using create_function_from_tensors to create a new TensorFlow function from an existing TF model or graph, the presence of control inputs can cause the extraction of a sub-graph to fail. These control inputs are generally only used during training, while this function is usually used for inference.

This PR adds a new argument to create_function_from_tensors to allow including control inputs, which are now omitted by default. To detect control inputs, we use the same criteria as the main TensorFlow package.

@psobot psobot added the bug Something isn't working label Jul 21, 2023
Copy link
Contributor

@drubinstein drubinstein left a comment

Choose a reason for hiding this comment

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

Can you create a new test for the include_control_inputs argument?

realbook/layers/compatibility.py Outdated Show resolved Hide resolved
@psobot psobot merged commit 26e62b3 into main Jul 24, 2023
24 checks passed
@psobot psobot deleted the psobot/control-inputs branch July 24, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants