| 213 | } |
| 214 | |
| 215 | void ComputeElementwise(OpKernelContext* ctx, const Tensor* cond, |
| 216 | const Tensor* then, const Tensor* else_) { |
| 217 | if (!ctx->ValidateInputsAreSameShape(this)) return; |
| 218 | Tensor* output = nullptr; |
| 219 | OP_REQUIRES_OK(ctx, ctx->forward_input_or_allocate_output( |
| 220 | {"t", "e"}, "output", then->shape(), &output)); |
| 221 | if (output->NumElements() > 0) { |
| 222 | functor::SelectFunctor<Device, T> func; |
| 223 | func(ctx->eigen_device<Device>(), output->flat<T>(), cond->flat<bool>(), |
| 224 | then->flat<T>(), else_->flat<T>()); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | void ComputeScalar(OpKernelContext* ctx, const Tensor* cond, |
| 229 | const Tensor* then, const Tensor* else_) { |
nothing calls this directly
no test coverage detected