Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/plugins/keras_support/ctc_decode_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,11 @@ namespace phylanx { namespace execution_tree { namespace primitives

primitive_arguments_type result;
result.reserve(2);

result.push_back(primitive_argument_type{
primitive_arguments_type first;
first.reserve(1);
first.push_back(primitive_argument_type{
std::move(decoded_dense_final)});
result.push_back(primitive_argument_type{std::move(first)});
result.push_back(
primitive_argument_type{std::move(log_prob)});

Expand Down
8 changes: 4 additions & 4 deletions tests/unit/plugins/keras_support/ctc_decode_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ void test_ctc_decode_operation_1()
hpx::future<phylanx::execution_tree::primitive_argument_type> f =
ctc_decode.eval();
auto result = phylanx::execution_tree::extract_list_value(f.get());

auto it = result.begin();
auto first = phylanx::execution_tree::extract_list_value(*it);

blaze::DynamicMatrix<double> expected_decoded_dense{{0.}, {0.}};
blaze::DynamicMatrix<double> expected_log_prob{{1.42711636}, {0.35667494}};

HPX_TEST_EQ(
phylanx::ir::node_data<double>(std::move(expected_decoded_dense)),
phylanx::execution_tree::extract_numeric_value(*it));
phylanx::execution_tree::extract_numeric_value(*first.begin()));
HPX_TEST(
allclose(phylanx::ir::node_data<double>(std::move(expected_log_prob)),
phylanx::execution_tree::extract_numeric_value(*++it)));
Expand Down Expand Up @@ -96,16 +96,16 @@ void test_ctc_decode_operation_2()
hpx::future<phylanx::execution_tree::primitive_argument_type> f =
ctc_decode.eval();
auto result = phylanx::execution_tree::extract_list_value(f.get());

auto it = result.begin();
auto first = phylanx::execution_tree::extract_list_value(*it);

blaze::DynamicMatrix<double> expected_decoded_dense{
{0., 1., -1.}, {1., 1., 0.}};
blaze::DynamicMatrix<double> expected_log_prob{{1.12701166}, {0.52680272}};

HPX_TEST_EQ(
phylanx::ir::node_data<double>(std::move(expected_decoded_dense)),
phylanx::execution_tree::extract_numeric_value(*it));
phylanx::execution_tree::extract_numeric_value(*first.begin()));
HPX_TEST(
allclose(phylanx::ir::node_data<double>(std::move(expected_log_prob)),
phylanx::execution_tree::extract_numeric_value(*++it)));
Expand Down