Commit 48b895c9 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fix two bugs related to the bert model

parent 8c6f1130
......@@ -490,6 +490,16 @@ struct onnx_parser
{
axis = parse_value(attributes.at("axis")).at<int>();
}
if(!args[0]->get_shape().standard())
{
args[0] = prog.add_instruction(op::contiguous{}, args[0]);
}
if(!args[1]->get_shape().standard())
{
args[1] = prog.add_instruction(op::contiguous{}, args[1]);
}
op::gather op{axis};
return prog.add_instruction(op, std::move(args));
}
......
......@@ -53,7 +53,7 @@ void quantize(program& prog, const std::vector<std::string>& ins_names)
// if the input is a convert operator, uses its input
// as its current input
instruction_ref input_fp16{};
if(input->name() == "convert")
if(input->name() == "convert" and input->inputs().front()->get_shape().type() == shape::half_type)
{
input_fp16 = input->inputs().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