提交 7b9f418c 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

use optimized_ops::TanH directly

PiperOrigin-RevId: 225299240
上级 7ac4a1e4
......@@ -373,11 +373,8 @@ TfLiteStatus TanhEval(TfLiteContext* context, TfLiteNode* node) {
TfLiteTensor* output = GetOutput(context, node, 0);
switch (input->type) {
case kTfLiteFloat32: {
size_t elements = input->bytes / sizeof(float);
float* in = input->data.f;
float* in_end = in + elements;
float* out = output->data.f;
for (; in < in_end; in++, out++) *out = std::tanh(*in);
optimized_ops::Tanh(GetTensorShape(input), GetTensorData<float>(input),
GetTensorShape(output), GetTensorData<float>(output));
return kTfLiteOk;
} break;
case kTfLiteInt16: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册