-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ODLA/DNNL]resize support nhwc #241
base: master
Are you sure you want to change the base?
Conversation
return SinkTranspose( | ||
*inst, [new_shape, inst](IRBuilder& builder, const std::string& name, | ||
const Def& op) { | ||
auto new_inst = builder.CreateResize(name, {op, *new_shape}); | ||
new_inst->CopyAttrsFrom(*inst); | ||
new_inst->SetAxesMask(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For NCHW, the masks are (0011), for NHWC, the masks are (0110). So there it should permute the bits for axe mask
|
||
float scale_h; | ||
float scale_w; | ||
std::vector<float> scales = {1.0f, 1.0f, 1.0f, 1.0f}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it can check each bit of axes_mask. if I-th bit is 0, scales[I] = 1
we don't need to worry about nhwc/nchw.
@@ -1348,11 +1348,28 @@ odla_value odla_Resize(odla_value input, odla_interpolation_mode interpolation, | |||
auto input_md = input->mem.get_desc(); | |||
auto dt = input->mem.get_desc().data_type(); | |||
|
|||
auto ret_md = dnnl::memory::desc(getDims(output_dims), dt, | |||
dnnl::memory::format_tag::nchw); | |||
auto format_tag = dnnl::memory::format_tag::nchw; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ret_md should be the same format_tag as input_md.
|
No description provided.