Fix: typo of scattermin op register. & append: scattermin/max/add test (#414)
Co-authored-by: Lei Wang <34334180+NjtechPrinceling@users.noreply.github.com>
This commit is contained in:
Родитель
f39d13297f
Коммит
028e88b88f
|
@ -32,4 +32,4 @@
|
||||||
REGISTER_SCATTER_OP(ScatterSub)
|
REGISTER_SCATTER_OP(ScatterSub)
|
||||||
REGISTER_SCATTER_OP(ScatterAdd)
|
REGISTER_SCATTER_OP(ScatterAdd)
|
||||||
REGISTER_SCATTER_OP(ScatterMax)
|
REGISTER_SCATTER_OP(ScatterMax)
|
||||||
REGISTER_SCATTER_OP(ScatterMim)
|
REGISTER_SCATTER_OP(ScatterMin)
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичные данные
test/models/tensorflow/frozen_op_graph/frozen_scattersub_graph.pb
Executable file → Normal file
Двоичные данные
test/models/tensorflow/frozen_op_graph/frozen_scattersub_graph.pb
Executable file → Normal file
Двоичный файл не отображается.
|
@ -551,13 +551,61 @@ TEST(nnfusion_tensorflow_import, sigmoid_op)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(nnfusion_tensorflow_import, scatteradd_op)
|
||||||
|
{
|
||||||
|
auto model = frontend::load_tensorflow_model(file_util::path_join(
|
||||||
|
SERIALIZED_ZOO, "tensorflow/frozen_op_graph/frozen_scatteradd_graph.pb"));
|
||||||
|
|
||||||
|
Inputs inputs{test::NDArray<float, 2>{{1, 1}, {1, 1}, {-1, -4}, {0, 1}}.get_vector()};
|
||||||
|
Outputs expected_outputs{{0, 0, 2, 3, 0, -1, 1, 1}};
|
||||||
|
|
||||||
|
Outputs outputs{execute(model, inputs, "NNFusion")};
|
||||||
|
EXPECT_EQ(outputs.size(), expected_outputs.size());
|
||||||
|
for (std::size_t i = 0; i < expected_outputs.size(); ++i)
|
||||||
|
{
|
||||||
|
EXPECT_EQ(expected_outputs[i], outputs[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST(nnfusion_tensorflow_import, scattersub_op)
|
TEST(nnfusion_tensorflow_import, scattersub_op)
|
||||||
{
|
{
|
||||||
auto model = frontend::load_tensorflow_model(file_util::path_join(
|
auto model = frontend::load_tensorflow_model(file_util::path_join(
|
||||||
SERIALIZED_ZOO, "tensorflow/frozen_op_graph/frozen_scattersub_graph.pb"));
|
SERIALIZED_ZOO, "tensorflow/frozen_op_graph/frozen_scattersub_graph.pb"));
|
||||||
|
|
||||||
Inputs inputs{};
|
Inputs inputs{test::NDArray<float, 2>{{1, 1}, {1, 1}, {-1, -4}, {0, 1}}.get_vector()};
|
||||||
Outputs expected_outputs{{1, 1, 1, 1, -3, -9, -1, 1}};
|
Outputs expected_outputs{{2, 2, 0, -1, -2, -7, -1, 1}};
|
||||||
|
|
||||||
|
Outputs outputs{execute(model, inputs, "NNFusion")};
|
||||||
|
EXPECT_EQ(outputs.size(), expected_outputs.size());
|
||||||
|
for (std::size_t i = 0; i < expected_outputs.size(); ++i)
|
||||||
|
{
|
||||||
|
EXPECT_EQ(expected_outputs[i], outputs[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(nnfusion_tensorflow_import, scattermax_op)
|
||||||
|
{
|
||||||
|
auto model = frontend::load_tensorflow_model(file_util::path_join(
|
||||||
|
SERIALIZED_ZOO, "tensorflow/frozen_op_graph/frozen_scattermax_graph.pb"));
|
||||||
|
|
||||||
|
Inputs inputs{test::NDArray<float, 2>{{1, 1}, {1, 1}, {-1, -4}, {0, 1}}.get_vector()};
|
||||||
|
Outputs expected_outputs{{1, 1, 1, 2, 1, 3, 1, 1}};
|
||||||
|
|
||||||
|
Outputs outputs{execute(model, inputs, "NNFusion")};
|
||||||
|
EXPECT_EQ(outputs.size(), expected_outputs.size());
|
||||||
|
for (std::size_t i = 0; i < expected_outputs.size(); ++i)
|
||||||
|
{
|
||||||
|
EXPECT_EQ(expected_outputs[i], outputs[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(nnfusion_tensorflow_import, scattermin_op)
|
||||||
|
{
|
||||||
|
auto model = frontend::load_tensorflow_model(file_util::path_join(
|
||||||
|
SERIALIZED_ZOO, "tensorflow/frozen_op_graph/frozen_scattermin_graph.pb"));
|
||||||
|
|
||||||
|
Inputs inputs{test::NDArray<float, 2>{{1, 1}, {1, 1}, {-1, -4}, {0, 1}}.get_vector()};
|
||||||
|
Outputs expected_outputs{{-1, -1, 1, 1, -1, -4, 0, 0}};
|
||||||
|
|
||||||
Outputs outputs{execute(model, inputs, "NNFusion")};
|
Outputs outputs{execute(model, inputs, "NNFusion")};
|
||||||
EXPECT_EQ(outputs.size(), expected_outputs.size());
|
EXPECT_EQ(outputs.size(), expected_outputs.size());
|
||||||
|
|
Загрузка…
Ссылка в новой задаче