Commit 6ca8ba97 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Robert Kimball

IntelGPU backend: Log operation accuracy fix (#2604)

parent bcd616a6
...@@ -233,11 +233,12 @@ static void do_universal_unary(cldnn::topology& topology, ...@@ -233,11 +233,12 @@ static void do_universal_unary(cldnn::topology& topology,
const shared_ptr<Node>& op, const shared_ptr<Node>& op,
const string& operation, const string& operation,
cldnn_activation_func mode, cldnn_activation_func mode,
bool force_custom = false,
const cldnn_activation_additional_params& param = {0.f, 0.f}) const cldnn_activation_additional_params& param = {0.f, 0.f})
{ {
arguments_check(op, 1, 1); arguments_check(op, 1, 1);
if (get_input_type(op) != element::f32) if (force_custom || (get_input_type(op) != element::f32))
{ {
do_custom_unary(topology, op, operation); do_custom_unary(topology, op, operation);
} }
...@@ -1211,7 +1212,8 @@ shared_ptr<runtime::Executable> ...@@ -1211,7 +1212,8 @@ shared_ptr<runtime::Executable>
} }
case OP_TYPEID::Log: case OP_TYPEID::Log:
{ {
do_universal_unary(topology, op, "log(input_var)", activation_log); // clDNN doesn't provide required accuracy
do_universal_unary(topology, op, "log(input_var)", activation_log, true);
break; break;
} }
case OP_TYPEID::Exp: case OP_TYPEID::Exp:
...@@ -1222,7 +1224,7 @@ shared_ptr<runtime::Executable> ...@@ -1222,7 +1224,7 @@ shared_ptr<runtime::Executable>
case OP_TYPEID::Negative: case OP_TYPEID::Negative:
{ {
const cldnn_activation_additional_params param = {-1.f, 0.f}; const cldnn_activation_additional_params param = {-1.f, 0.f};
do_universal_unary(topology, op, "-(input_var)", activation_linear, param); do_universal_unary(topology, op, "-(input_var)", activation_linear, false, param);
break; break;
} }
case OP_TYPEID::Relu: case OP_TYPEID::Relu:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment