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

Function Clamp

tensorflow/core/kernels/meta_support.cc:385–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385void Clamp(OpKernelContext* tf_context, const quint8* input, int count,
386 quint8 clamp_min, quint8 clamp_max, quint8* output) {
387#ifdef TENSORFLOW_USE_META
388 mutex_lock library_lock(GetMutex());
389 typedef gemmlowp::meta::Transform1DParams<uint8_t, uint8_t,
390 gemmlowp::meta::MinMax<uint8_t>>
391 Params;
392
393 Params params;
394 params.input = reinterpret_cast<const uint8_t*>(input);
395 params.output = reinterpret_cast<uint8_t*>(output);
396 params.kernel.count = count;
397 params.kernel.min = clamp_min;
398 params.kernel.max = clamp_max;
399
400 MultiThreadTransform1D<Params, 16>(tf_context, params);
401#else
402 LOG(FATAL) << "Clamp: Meta fastpath not supported.";
403#endif
404}
405
406} // namespace meta
407} // namespace tensorflow

Callers 4

ComputeMethod · 0.70
ComputeMethod · 0.70
ComputeSpansCoreFunction · 0.70
SampleFunction · 0.70

Calls 1

GetMutexFunction · 0.85

Tested by 1

SampleFunction · 0.56