diff options
author | Eugene Brevdo <ebrevdo@gmail.com> | 2016-02-02 11:35:09 -0800 |
---|---|---|
committer | Vijay Vasudevan <vrv@google.com> | 2016-02-02 16:30:20 -0800 |
commit | 9ede62fccd761203c17250afe5c132fb82aa689d (patch) | |
tree | 9b0ab52af242755aa5c5a9f906f7e976ec722303 /tensorflow/core/kernels/cwise_ops_gpu_common.cu.h | |
parent | 34afdbbcf35309416568dd96422c45aaefdf0f84 (diff) |
Select op can now broadcast when the condition is a vector.
In this case, instead of operating element-wise it operates
row-wise on arbitrary rank tensors.
This alternate calculation happens when the cond Tensor
is a vector whose size matches the row count of the 'then'
and 'else' tensors.
GPU-enabled + tests. Will be used for intelligent update of RNN states during
dynamic with computation variable sequence lengths in a minibatch.
Change: 113659369
Diffstat (limited to 'tensorflow/core/kernels/cwise_ops_gpu_common.cu.h')
-rw-r--r-- | tensorflow/core/kernels/cwise_ops_gpu_common.cu.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h b/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h index f57a908122..127c20c128 100644 --- a/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h +++ b/tensorflow/core/kernels/cwise_ops_gpu_common.cu.h @@ -102,17 +102,6 @@ struct BinaryFunctor<GPUDevice, Functor, NDIMS> { } }; -template <typename T> -struct SelectFunctor<GPUDevice, T> { - void operator()(const GPUDevice& d, typename TTypes<T>::Flat out, - typename TTypes<bool>::ConstFlat cond_flat, - typename TTypes<T>::ConstFlat then_flat, - typename TTypes<T>::ConstFlat else_flat) { - To32Bit(out).device(d) = - To32Bit(cond_flat).select(To32Bit(then_flat), To32Bit(else_flat)); - } -}; - // Macros to explicitly instantiate kernels on GPU for multiple types // (T0, T1, etc.) for UnaryFunctor (e.g., functor:sqrt). #define DEFINE_UNARY1(F, T) template struct UnaryFunctor<GPUDevice, F<T> > |