Fix SliceChannel Type inference#16748
Conversation
src/operator/slice_channel-inl.h
Outdated
| bool InferType(std::vector<int> *in_type, | ||
| std::vector<int> *out_type, | ||
| std::vector<int> *aux_type) const override { | ||
| /* |
There was a problem hiding this comment.
If this is to be removed, why is it commented? Or is this temporary?
There was a problem hiding this comment.
yes, it should have been removed. Good catch, fixed.
| data2._set_attr(__dtype__="-1") | ||
| concat_res = mx.sym.concat(data, data2) | ||
| out = mx.sym.split(concat_res, axis=1, num_outputs=2) | ||
| final_res = amp.convert_symbol(out) |
There was a problem hiding this comment.
Any checks or assertions needed?
There was a problem hiding this comment.
no, this was earlier failing in the convert_symbol call before this change. Just need to check if convert_symbol completes successfully.
d995250 to
86221d0
Compare
|
I don't know enough to comment on the changes to the example etc., but the main fix from this PR (InferType in SliceChannel) looks good. @anirudh2290 Searching for |
|
@ptrendx how did you come up with that sentence ? EDIT: Never mind, its the same error message. |
|
@ptrendx good point about the other places where error is raised. The scope of the PR increased :) . Can we start with this PR first and I will follow up with another PR/PRs for fixes in other ops. Sorry, little busy with other deliverables too and cannot do it immediately. For the examples, I have tested running the gluon models for conversion and dummy inference in a loop. |
|
Sure, having this PR fix just SliceChannel is totally fine. |
* Refactor elemwise_op_common and change SliceChannel InferType * Add gluoncv models * Comment Faster RCNN models
Description
Fix SliceChannel Type Inference. Do forward and backward inference for slice channel with ElemwiseAttr logic. Remove exception thrown from infer_type logic in slice channel.
Adds some gluoncv models to AMP examples.
@ptrendx
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments