Commit 3b84d91a authored by Adam Procter's avatar Adam Procter Committed by Robert Kimball

Interpreter tweaks (#311)

* Replace function->get_result()->get_outputs() call with function->get_outputs()

* Test for parameter straight to output

* Roll back cmake modification for INTERPRETER autodiff
parent 3c900fed
......@@ -48,8 +48,8 @@ void runtime::interpreter::INT_CallFrame::call(
}
for (size_t i = 0; i < output_tvs.size(); i++)
{
descriptor::Output& output = function->get_result()->get_outputs().at(i);
shared_ptr<descriptor::TensorView> tv = output.get_tensor_view();
descriptor::Output* output = function->get_outputs().at(i);
shared_ptr<descriptor::TensorView> tv = output->get_tensor_view();
string name = tv->get_tensor().get_name();
tensor_map.insert({name, output_tvs[i]});
}
......
......@@ -4596,3 +4596,23 @@ TEST(DISABLED_${BACKEND_NAME}, dot_4d_5d_multi_axis_big_fp64_VERY_SLOW)
2.48832492480234188800e+18, 2.48832518400031897600e+18},
result->get_vector<double>()));
}
TEST(${BACKEND_NAME}, DISABLED_parameter_to_output)
{
auto shape = Shape{2, 2};
auto A = make_shared<op::Parameter>(element::Float32::element_type(), shape);
auto f = make_shared<Function>(A, op::Parameters{A});
auto manager = runtime::Manager::get("${BACKEND_NAME}");
auto external = manager->compile(f);
auto backend = manager->allocate_backend();
auto cf = backend->make_call_frame(external);
// Create some tensors for input/output
auto a = backend->make_primary_tensor_view(element::Float32::element_type(), shape);
copy_data(a, vector<float>{1, -2, 0, -4.8f});
auto result = backend->make_primary_tensor_view(element::Float32::element_type(), shape);
cf->call({a}, {result});
EXPECT_EQ((vector<float>{1, -2, 0, -4.8f}), result->get_vector<float>());
}
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