diff options
author | 2017-10-02 14:57:50 -0700 | |
---|---|---|
committer | 2017-10-02 15:00:51 -0700 | |
commit | a470779865883706dc2db1dcd8bd386527e1df03 (patch) | |
tree | 39b43185b5bf90564d6b3fd3ca916d66aa8764ce /tensorflow/core/kernels/where_op_gpu_impl_2.cu.cc | |
parent | 553d10cfe42edcb6b3b8d748b315f13925fcf28f (diff) |
TF WhereOp now acts more like np.where: extend input types to any numeric type.
(with the exception of tf.half).
This allows one to call:
tf.where(float_tensor)
instead of
tf.where(tf.not_equal(float_tensor, 0))
or
tf.where(complex_tensor)
instead of
tf.where(tf.not_equal(tf.abs(complex_tensor), 0))
PiperOrigin-RevId: 170758184
Diffstat (limited to 'tensorflow/core/kernels/where_op_gpu_impl_2.cu.cc')
-rw-r--r-- | tensorflow/core/kernels/where_op_gpu_impl_2.cu.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/where_op_gpu_impl_2.cu.cc b/tensorflow/core/kernels/where_op_gpu_impl_2.cu.cc new file mode 100644 index 0000000000..3a62259608 --- /dev/null +++ b/tensorflow/core/kernels/where_op_gpu_impl_2.cu.cc @@ -0,0 +1,18 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#define GPU_PROVIDED_DIM 2 +#include "tensorflow/core/kernels/where_op_gpu.cu.h" +#undef GPU_PROVIDED_DIM |