haskell
haskell copied to clipboard
Searching for Condition
is the equivalent of tf.cond
somewhere? I am unable to find it...
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?
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.
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
.