提交 ac1c0a40 编写于 作者: Z zhangyang

assign value forscale pointer

上级 b1af2667
...@@ -49,6 +49,7 @@ class FeedOp : public framework::OperatorBase<DeviceType> { ...@@ -49,6 +49,7 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
auto input_ptr = input->data<float>(); auto input_ptr = input->data<float>();
Tensor *output = param_.Out(); Tensor *output = param_.Out();
auto output_ptr = output->mutable_data<half>(); auto output_ptr = output->mutable_data<half>();
auto out_address = output->fpga_args().scale_pointer();
fpga::BypassArgs args; fpga::BypassArgs args;
args.convert_type = fpga::DATA_FP32_TO_FP16; args.convert_type = fpga::DATA_FP32_TO_FP16;
args.layout_type = fpga::LAYOUT_CHW_TO_HWC; args.layout_type = fpga::LAYOUT_CHW_TO_HWC;
...@@ -59,6 +60,7 @@ class FeedOp : public framework::OperatorBase<DeviceType> { ...@@ -59,6 +60,7 @@ class FeedOp : public framework::OperatorBase<DeviceType> {
args.image.pad_height = 0; args.image.pad_height = 0;
args.image.pad_width = 0; args.image.pad_width = 0;
args.output.address = output_ptr; args.output.address = output_ptr;
args.output.scale_address = out_address;
fpga::PerformBypass(args); fpga::PerformBypass(args);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册