Remove deprecated legacy transpose ref function (#5765)
This commit is contained in:
parent
e54a3882ee
commit
eba2410411
@ -31,50 +31,6 @@ namespace ngraph
|
|||||||
runtime::opt_kernel::reshape(
|
runtime::opt_kernel::reshape(
|
||||||
data, out, data_shape, axis_vector, out_shape, element_size);
|
data, out, data_shape, axis_vector, out_shape, element_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy function template to ensure backward compatibility
|
|
||||||
// Can be removed after ARM plugin start using evaluate or no template function
|
|
||||||
template <typename T, typename U>
|
|
||||||
NGRAPH_DEPRECATED(
|
|
||||||
"Traspose function with template types is deprecated, use function with char* "
|
|
||||||
"args.")
|
|
||||||
void transpose(const T* arg, T* out, Shape arg_shape, const U* axes_order = nullptr)
|
|
||||||
{
|
|
||||||
std::vector<std::int64_t> converted_axes_order(arg_shape.size());
|
|
||||||
if (axes_order == nullptr)
|
|
||||||
{
|
|
||||||
std::iota(converted_axes_order.begin(), converted_axes_order.end(), 0);
|
|
||||||
std::reverse(converted_axes_order.begin(), converted_axes_order.end());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < converted_axes_order.size(); ++i)
|
|
||||||
{
|
|
||||||
converted_axes_order[i] = static_cast<std::int64_t>(axes_order[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Shape output_shape(arg_shape.size());
|
|
||||||
std::transform(
|
|
||||||
converted_axes_order.begin(),
|
|
||||||
converted_axes_order.end(),
|
|
||||||
output_shape.begin(),
|
|
||||||
[&](const int64_t& v) {
|
|
||||||
NGRAPH_CHECK(v >= 0,
|
|
||||||
"Negative values for transpose axes order are not supported.");
|
|
||||||
NGRAPH_CHECK(v < int64_t(arg_shape.size()),
|
|
||||||
"Transpose axis ",
|
|
||||||
v,
|
|
||||||
" is out of shape range.");
|
|
||||||
return arg_shape[v];
|
|
||||||
});
|
|
||||||
|
|
||||||
transpose(reinterpret_cast<const char*>(arg),
|
|
||||||
reinterpret_cast<char*>(out),
|
|
||||||
arg_shape,
|
|
||||||
sizeof(T),
|
|
||||||
converted_axes_order.data(),
|
|
||||||
output_shape);
|
|
||||||
}
|
|
||||||
} // namespace reference
|
} // namespace reference
|
||||||
} // namespace runtime
|
} // namespace runtime
|
||||||
} // namespace ngraph
|
} // namespace ngraph
|
||||||
|
@ -44,14 +44,6 @@ void test_tranpose_eval(shared_ptr<Function> fun)
|
|||||||
|
|
||||||
auto actual_results = read_vector<T>(result_tensor);
|
auto actual_results = read_vector<T>(result_tensor);
|
||||||
ASSERT_EQ(actual_results, expected_results[i]);
|
ASSERT_EQ(actual_results, expected_results[i]);
|
||||||
|
|
||||||
{ // Temporary test for legacy reference function template
|
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_START
|
|
||||||
std::vector<T> ref_results(input_data[i].size());
|
|
||||||
runtime::reference::transpose<T, T_AXIS>(input_data[i].data(), ref_results.data(), data_shapes[i], axes_order[i].data());
|
|
||||||
ASSERT_EQ(ref_results, expected_results[i]);
|
|
||||||
NGRAPH_SUPPRESS_DEPRECATED_END
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user