Commit 8a062c4a authored by Jayaram Bobba's avatar Jayaram Bobba Committed by Scott Cyphers

Remove static cache in unit test since backends keep cache of compiled functions already (#3117)

parent 0552fd84
...@@ -90,20 +90,7 @@ namespace ngraph ...@@ -90,20 +90,7 @@ namespace ngraph
auto c_vec = read_vector<T>(c_arg); auto c_vec = read_vector<T>(c_arg);
fill(c_vec.begin(), c_vec.end(), static_cast<T>(0)); fill(c_vec.begin(), c_vec.end(), static_cast<T>(0));
static std::unordered_map<std::shared_ptr<Function>, auto df_handle = backend->compile(df);
std::shared_ptr<runtime::Executable>>
s_compiled_functions;
auto it = s_compiled_functions.find(df);
std::shared_ptr<runtime::Executable> df_handle;
if (it == s_compiled_functions.end())
{
df_handle = backend->compile(df);
s_compiled_functions.insert({df, df_handle});
}
else
{
df_handle = it->second;
}
// for each element of the adjoint // for each element of the adjoint
// same as saying for each element of y // same as saying for each element of y
...@@ -212,20 +199,7 @@ namespace ngraph ...@@ -212,20 +199,7 @@ namespace ngraph
s_clone_fwd_map[f] = clone_function(*fprop_cache.fprop); s_clone_fwd_map[f] = clone_function(*fprop_cache.fprop);
} }
auto clone_fwd = s_clone_fwd_map[f]; auto clone_fwd = s_clone_fwd_map[f];
static std::unordered_map<std::shared_ptr<Function>, auto clone_fwd_handle = backend->compile(clone_fwd);
std::shared_ptr<runtime::Executable>>
s_compiled_functions;
auto it = s_compiled_functions.find(clone_fwd);
std::shared_ptr<runtime::Executable> clone_fwd_handle;
if (it == s_compiled_functions.end())
{
clone_fwd_handle = backend->compile(clone_fwd);
s_compiled_functions.insert({clone_fwd, clone_fwd_handle});
}
else
{
clone_fwd_handle = it->second;
}
clone_fwd_handle->call_with_validate(mod_f_output_args, f_input_args); clone_fwd_handle->call_with_validate(mod_f_output_args, f_input_args);
......
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