Commit 8f992e4a authored by Shucai Xiao's avatar Shucai Xiao
Browse files

add an additional check for the capture operator

parent eab3cafb
...@@ -31,8 +31,16 @@ struct capture ...@@ -31,8 +31,16 @@ struct capture
shape compute_shape(std::vector<shape> inputs) const { return inputs.front(); } shape compute_shape(std::vector<shape> inputs) const { return inputs.front(); }
argument compute(const shape&, std::vector<argument> args) const argument compute(const shape&, std::vector<argument> args) const
{
if (f)
{ {
f(ins_index, args); f(ins_index, args);
}
else
{
MIGRAPHX_THROW("CAPTURE: callback function is not callable!");
}
return args.front(); return args.front();
} }
}; };
......
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