Commit b94a3978 authored by Adam Rogowiec's avatar Adam Rogowiec

Remove unnecessary UT and apply style.

parent e349b31d
......@@ -23,11 +23,6 @@ graph {
i: 3
type: INT
}
attribute {
name: "input_forget"
i: 0
type: INT
}
}
name: "compute_graph"
input {
......
ir_version: 4
producer_name: "nGraph ONNX Importer"
graph {
node {
input: "X"
input: "W"
input: "R"
output: ""
output: "Y_h"
op_type: "LSTM"
attribute {
name: "clip"
f: 4.0
type: FLOAT
}
attribute {
name: "direction"
s: "forward"
type: STRING
}
attribute {
name: "hidden_size"
i: 3
type: INT
}
attribute {
name: "input_forget"
i: 0
type: INT
}
}
name: "compute_graph"
input {
name: "X"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 2
}
dim {
dim_value: 32
}
dim {
dim_value: 1
}
}
}
}
}
input {
name: "W"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 12
}
dim {
dim_value: 1
}
}
}
}
}
input {
name: "R"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 12
}
dim {
dim_value: 3
}
}
}
}
}
output {
name: "Y_h"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 32
}
dim {
dim_value: 3
}
}
}
}
}
}
opset_import {
version: 7
}
......@@ -205,69 +205,6 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_hardsigmoid_activation)
test_case.run();
}
NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_large_batch_with_clip)
{
auto function = onnx_import::import_onnx_model(
file_util::path_join(SERIALIZED_ZOO, "onnx/lstm_fwd_large_batch_with_clip.prototxt"));
auto test_case = ngraph::test::NgraphTestCase(function, "${BACKEND_NAME}");
std::size_t seq_length = 2;
std::size_t batch_size = 32;
std::size_t input_size = 1;
std::size_t hidden_size = 3;
std::vector<float> in_X(seq_length * batch_size * input_size);
std::iota(std::begin(in_X), std::end(in_X), 1.f);
std::vector<float> in_R(4 * hidden_size * hidden_size, 0.1f);
// X
test_case.add_input<float>(in_X);
// W
test_case.add_input<float>(
{0.1f, 0.2f, 0.3f, 0.4f, 1.f, 2.f, 3.f, 4.f, 10.f, 11.f, 12.f, 13.f});
// R
test_case.add_input<float>(in_R);
// Y_h_data
test_case.add_expected_output<float>(
Shape{1, batch_size, hidden_size},
{0.88572926f, 0.89251395f, 0.89655037f,
0.89074291f, 0.90035688f, 0.90727429f,
0.89535827f, 0.90727429f, 0.91596163f,
0.89963124f, 0.91328279f, 0.9228067f,
0.90358195f, 0.91843507f, 0.92809163f,
0.90723279f, 0.9228067f, 0.93211437f,
0.91038955f, 0.92648469f, 0.93514718f,
0.91328279f, 0.92955856f, 0.93741938f,
0.91596163f, 0.93211437f, 0.9391149f,
0.91843507f, 0.93423112f, 0.94037686f,
0.92071318f, 0.9359791f, 0.94131462f,
0.9228067f, 0.93741938f, 0.94201073f,
0.92472679f, 0.9386042f, 0.94252713f,
0.92648469f, 0.9395777f, 0.94266769f,
0.92809163f, 0.94037686f, 0.94266769f,
0.92955856f, 0.94103248f, 0.94266769f,
0.93089609f, 0.94157007f, 0.94266769f,
0.93211437f, 0.94201073f, 0.94266769f,
0.93322302f, 0.94237184f, 0.94266769f,
0.93423112f, 0.94266769f, 0.94266769f,
0.93514718f, 0.94266769f, 0.94266769f,
0.9359791f, 0.94266769f, 0.94266769f,
0.93673424f, 0.94266769f, 0.94266769f,
0.93741938f, 0.94266769f, 0.94266769f,
0.93804079f, 0.94266769f, 0.94266769f,
0.9386042f, 0.94266769f, 0.94266769f,
0.9391149f, 0.94266769f, 0.94266769f,
0.9395777f, 0.94266769f, 0.94266769f,
0.93999702f, 0.94266769f, 0.94266769f,
0.94037686f, 0.94266769f, 0.94266769f,
0.94072091f, 0.94266769f, 0.94266769f,
0.94103248f, 0.94266769f, 0.94266769f});
test_case.run();
}
NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_large_batch_no_clip)
{
auto function = onnx_import::import_onnx_model(
......@@ -288,45 +225,27 @@ NGRAPH_TEST(onnx_${BACKEND_NAME}, model_lstm_fwd_large_batch_no_clip)
test_case.add_input<float>(in_X);
// W
test_case.add_input<float>(
{0.1f, 0.2f, 0.3f, 0.4f, 1.f, 2.f, 3.f, 4.f, 10.f, 11.f, 12.f, 13.f});
{0.1f, 0.2f, 0.3f, 0.4f, 1.f, 2.f, 3.f, 4.f, 10.f, 11.f, 12.f, 13.f});
// R
test_case.add_input<float>(in_R);
// Y_h_data
test_case.add_expected_output<float>(
Shape{1, batch_size, hidden_size},
{0.90387899f, 0.9135572f, 0.91772245f,
0.90897038f, 0.92132433f, 0.92825467f,
0.91365823f, 0.92815113f, 0.93676105f,
0.91799162f, 0.93406357f, 0.94344562f,
0.92199681f, 0.93912057f, 0.94859476f,
0.92569357f, 0.94340185f, 0.95250664f,
0.92909964f, 0.94699686f, 0.95545127f,
0.93223207f, 0.94999634f, 0.95765468f,
0.93510761f, 0.9524867f, 0.95929726f,
0.93774272f, 0.9545467f, 0.96051891f,
0.9401536f, 0.95624603f, 0.96142619f,
0.94235605f, 0.95764499f, 0.96209939f,
0.94436539f, 0.95879495f, 0.96259862f,
0.94619635f, 0.95973921f, 0.96296872f,
0.94786299f, 0.96051397f, 0.96324302f,
0.94937864f, 0.96114929f, 0.96344629f,
0.95075587f, 0.96167006f, 0.96359692f,
0.95200645f, 0.96209679f, 0.96370852f,
0.95314133f, 0.9624464f, 0.9637912f,
0.95417069f, 0.96273278f, 0.96385246f,
0.95510395f, 0.96296733f, 0.96389785f,
0.95594975f, 0.96315942f, 0.96393147f,
0.95671607f, 0.96331673f, 0.96395638f,
0.9574102f, 0.96344554f, 0.96397483f,
0.9580388f, 0.96355102f, 0.9639885f,
0.95860795f, 0.96363739f, 0.96399863f,
0.95912322f, 0.96370811f, 0.96400613f,
0.95958963f, 0.96376601f, 0.96401169f,
0.96001179f, 0.96381342f, 0.96401581f,
0.96039386f, 0.96385224f, 0.96401886f,
0.96073964f, 0.96388402f, 0.96402112f,
0.96105254f, 0.96391004f, 0.96402279f});
{0.90387899f, 0.9135572f, 0.91772245f, 0.90897038f, 0.92132433f, 0.92825467f, 0.91365823f,
0.92815113f, 0.93676105f, 0.91799162f, 0.93406357f, 0.94344562f, 0.92199681f, 0.93912057f,
0.94859476f, 0.92569357f, 0.94340185f, 0.95250664f, 0.92909964f, 0.94699686f, 0.95545127f,
0.93223207f, 0.94999634f, 0.95765468f, 0.93510761f, 0.9524867f, 0.95929726f, 0.93774272f,
0.9545467f, 0.96051891f, 0.9401536f, 0.95624603f, 0.96142619f, 0.94235605f, 0.95764499f,
0.96209939f, 0.94436539f, 0.95879495f, 0.96259862f, 0.94619635f, 0.95973921f, 0.96296872f,
0.94786299f, 0.96051397f, 0.96324302f, 0.94937864f, 0.96114929f, 0.96344629f, 0.95075587f,
0.96167006f, 0.96359692f, 0.95200645f, 0.96209679f, 0.96370852f, 0.95314133f, 0.9624464f,
0.9637912f, 0.95417069f, 0.96273278f, 0.96385246f, 0.95510395f, 0.96296733f, 0.96389785f,
0.95594975f, 0.96315942f, 0.96393147f, 0.95671607f, 0.96331673f, 0.96395638f, 0.9574102f,
0.96344554f, 0.96397483f, 0.9580388f, 0.96355102f, 0.9639885f, 0.95860795f, 0.96363739f,
0.96399863f, 0.95912322f, 0.96370811f, 0.96400613f, 0.95958963f, 0.96376601f, 0.96401169f,
0.96001179f, 0.96381342f, 0.96401581f, 0.96039386f, 0.96385224f, 0.96401886f, 0.96073964f,
0.96388402f, 0.96402112f, 0.96105254f, 0.96391004f, 0.96402279f});
test_case.run();
}
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