TfLiteStatus AbsEval(TfLiteContext* context, TfLiteNode* node) {
  const TfLiteType type = GetInput(context, node, 0)->type;
  switch (type) {
    case kTfLiteFloat32:
      return EvalImpl<float>(context, node, std::abs<float>, type);
    case kTfLiteInt8: {
      const auto* op_data = static_cast<const OpData*>(node->user_data);
      const int kMinInt8 = std::numeric_limits<int8_t>::min();
      const int kMaxInt8 = std::numeric_limits<int8_t>::max();
      std::function<int8_t(int8_t)> func = [&](int8_t i) {
        const int32_t value = std::abs(i - op_data->input_offset);
        return std::min(
            std::max(op_data->output_offset +
                         MultiplyByQuantizedMultiplier(
                             value, op_data->multiplier, op_data->shift),
                     kMinInt8),
            kMaxInt8);
      };
      return EvalImpl<int8_t>(context, node, func, type);
    }
    default:
      TF_LITE_KERNEL_LOG(context, "Current data type %s is not supported.",
                         TfLiteTypeGetName(type));
      return kTfLiteError;
  }
}
TfLiteStatus AbsEval(TfLiteContext* context, TfLiteNode* node) {
  const TfLiteType type = GetInput(context, node, 0)->type;
  switch (type) {
    case kTfLiteFloat32:
      return EvalImpl<float>(context, node, std::abs<float>, type);
    case kTfLiteInt8: {
      const auto* op_data = static_cast<const OpData*>(node->user_data);
      const int kMinInt8 = std::numeric_limits<int8_t>::min();
      const int kMaxInt8 = std::numeric_limits<int8_t>::max();
      std::function<int8_t(int8_t)> func = [&](int8_t i) {
        const int32_t value = std::abs(i - op_data->input_offset);
        return std::min(
            std::max(op_data->output_offset +
                         MultiplyByQuantizedMultiplier(
                             value, op_data->multiplier, op_data->shift),
                     kMinInt8),
            kMaxInt8);
      };
      return EvalImpl<int8_t>(context, node, func, type);
    }
    default:
      TF_LITE_KERNEL_LOG(context, "Current data type %s is not supported.",
                         TfLiteTypeGetName(type));
      return kTfLiteError;
  }
}