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

Searching for Condition #176

Open
LeanderK opened this issue Feb 19, 2018 · 3 comments
Open

Searching for Condition #176

LeanderK opened this issue Feb 19, 2018 · 3 comments

Comments

@LeanderK
Copy link

is the equivalent of tf.cond somewhere? I am unable to find it...

@LeanderK LeanderK changed the title Condition Searching for Condition Feb 19, 2018
@blackgnezdo
Copy link
Contributor

The closest I can think of is select. Can you make it work for your use case? If not, could you share more about your requirements and maybe somebody will have a suggestion for you?

@LeanderK
Copy link
Author

maybe it could work, but it's for control flow on the tensor-layer (what I mean is that it doesn't depend on the values of the elements of the tensors). I want to switch between different ways to execute my graph since my training and test environment are different.

@fkm3
Copy link
Contributor

fkm3 commented Feb 20, 2018

Not sure what you mean. Our select is the same as the python tf.where. Both tf.cond and tf.where act on the values of the predicate at graph execution time, but I think tf.cond has a guarantee that it will only evaluate one branch so that you can use it with mutating ops like tf.assign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants