Commit a24048bd authored by Brian Pickrell's avatar Brian Pickrell
Browse files

work in progress. Need to support Upsample instruction

parent 35919b44
...@@ -183,7 +183,9 @@ static std::string get_nearest_mode(const onnx_parser::attribute_map& attr) ...@@ -183,7 +183,9 @@ static std::string get_nearest_mode(const onnx_parser::attribute_map& attr)
struct parse_resize : op_parser<parse_resize> struct parse_resize : op_parser<parse_resize>
{ {
std::vector<op_desc> operators() const { return {{"Resize"}, {"Upsample"}}; } std::vector<op_desc> operators() const {
return {{"Resize"}, {"Upsample"}};
}
// A helper for one case of parse(). // A helper for one case of parse().
// Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th // Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th
...@@ -320,9 +322,9 @@ struct parse_resize : op_parser<parse_resize> ...@@ -320,9 +322,9 @@ struct parse_resize : op_parser<parse_resize>
": no dynamic input shapes allowed except the first one"); ": no dynamic input shapes allowed except the first one");
} }
// skip first input and any empty inputs // skip first input (if dynamic) and any empty inputs
auto lens = arg->get_shape().to_static(1).lens(); auto lens = arg->get_shape().to_static(1).lens();
if(arg->name() == "undefined" or arg == args.front() or lens.empty()) if(arg->name() == "undefined" or (arg == args[0] and arg->get_shape().dynamic()) or lens.empty())
{ {
continue; continue;
} }
...@@ -379,7 +381,9 @@ struct parse_resize : op_parser<parse_resize> ...@@ -379,7 +381,9 @@ struct parse_resize : op_parser<parse_resize>
}); });
break; break;
} }
} }
if(out_lens.size() == 0)
MIGRAPHX_THROW("PARSE_" + opd.op_name + ": no input was given for scale or output size");
// Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th // Dynamic batch: Only args[0] can have a dynamic shape, only the 0'th
// dimension--batch size--can be non-fixed, and the only resize mode allowed is "nearest" // dimension--batch size--can be non-fixed, and the only resize mode allowed is "nearest"
......
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