aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/functional_ops.cc
Commit message (Collapse)AuthorAge
* Added forked versions of stateless If and While ops. They should only be used,Gravatar Mingsheng Hong2018-08-08
| | | | | | | | | | | when the if then/else body of If or the While body funcs do not have stateful ops. The are lowered to the same XLA ops. One use case is in the S4TF compiler: https://github.com/apple/swift/pull/18509 PiperOrigin-RevId: 207977126
* Simplified the WhileOp kernel impl by removing the handle cache based onGravatar Mingsheng Hong2018-08-01
| | | | | | suggestion from apassos@ -- the underlying lib->Instantiate() does the caching. PiperOrigin-RevId: 206993242
* Mark the If op stateful, so that it won't get pruned away in a graph function,Gravatar Mingsheng Hong2018-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when we only run that If op for its side effects (e.g. enqueuing tensors.) Also extended the kernel impl to handle the case where the kernel works with multiple functional libs through its lifetime (b/37549631). The code is modeled after the WhileOp kernel impl. An example graph function that runs If for its side-effects is: function { signature { name: "S12control_flow23testTensorEnqueueInCondyySb_SftF.tf_CPU.device_partition" input_arg { name: "arg_0" type: DT_FLOAT # DT_BOOL } } node_def { name: "op/testTensorEnqueueInCond.14.14" op: "Const" device: "/device:CPU:0" attr { key: "dtype" value { type: DT_FLOAT } } attr { key: "value" value { tensor { dtype: DT_FLOAT tensor_shape { } float_val: 1 } } } } node_def { name: "op/testTensorEnqueueInCond_5.22.3" op: "If" input: "arg_0" input: "op/testTensorEnqueueInCond.14.14:output:0" attr { key: "Tcond" value { type: DT_FLOAT # DT_BOOL } } attr { key: "Tin" value { list { type: DT_FLOAT } } } attr { key: "Tout" value { list { } } } attr { key: "else_branch" value { func { name: "false/testTensorEnqueueInCond_4.22.3" } } } attr { key: "then_branch" value { func { name: "true/testTensorEnqueueInCond_3.22.3" } } } } } PiperOrigin-RevId: 206983563
* Support Defuns and nested Defuns inside cond_v2 branches.Gravatar Saurabh Saxena2018-07-19
| | | | | | Support nested cond_v2s. PiperOrigin-RevId: 205356562
* Avoid unintentional copy of a const function when capturing it.Gravatar Derek Murray2018-06-07
| | | | PiperOrigin-RevId: 199702086
* Avoid unnecessary `DoneCallback` copies in functional_ops.cc.Gravatar Derek Murray2018-06-07
| | | | PiperOrigin-RevId: 199674121
* Introduce tf.contrib.control_flow.new_cond.Gravatar Skye Wanderman-Milne2018-06-05
| | | | | | | | | | | | | | | | new_cond is a new implementation of tf.cond. Instead of emitting control flow ops (i.e. Switch and Merge nodes), new_cond emits a single If op, which represents the conditional branches as TF functions. With this change, users can use new_cond and take its gradient. The idea is for new_cond to eventually replace tf.cond. There are several functional and performance gaps that must be addressed first, including: * Gradients won't work on imported graphs * Misc. limitations of TF functions (lack of collections, device scopes, etc.) PiperOrigin-RevId: 199346735
* Fix functional.While(), functional.For(rewrite_with_while)Gravatar James Qin2018-05-14
| | | | | | When executing on GPU, synchronously copy cond result from device to host. PiperOrigin-RevId: 196580820
* Export the rest of If, While, and For.Gravatar Patrick Nguyen2018-04-02
| | | | | | | We keep _If and _While. This moves the tests and python generators. The operators are not part of the public tensorflow API. PiperOrigin-RevId: 191344237
* Internal functional _If and _While ops.Gravatar Alexandre Passos2018-02-08
PiperOrigin-RevId: 185042663