MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ComputeElementwise

Method ComputeElementwise

tensorflow/core/kernels/cwise_op_select.cc:215–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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_) {

Callers

nothing calls this directly

Calls 5

funcFunction · 0.50
shapeMethod · 0.45
NumElementsMethod · 0.45

Tested by

no test coverage detected