-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[GPU] Update creating SpaceToBatch and BatchToSpace for dynamic and static #29415
[GPU] Update creating SpaceToBatch and BatchToSpace for dynamic and static #29415
Conversation
auto output_pshape = op->get_output_partial_shape(0); | ||
auto out_size = output_pshape.is_static() ? tensor_from_dims(output_pshape.to_shape()) : cldnn::tensor(); | ||
|
||
if (non_constant_input) { |
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.
Could you explain the behavior? I cannot understand how it would work. For example, if the model is static but input is not constant (!op->is_dynamic() && non_constant_input
), I guess it should go through the "then" block of if
. (batch_to_space(layerName, inputs, out_size)
) But with your change, it would go to "else" block of if
. I guess that wouldn't work.
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.
This code to check if it is constant or not is old (about 1.5 years ago) and is no longer needed, because in recent OpenVINO, we don't care if the input is a constant node or a parameter node. Instead of checking if it is a constant node, we need to check for dynamic because we need a dummy for the dynamic case.
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.
There is a code std::vector<int32_t> sizes = inConst->cast_vector<int32_t>();
below. It assumes that the input is a constant node. It conflicts with what you are saying ("in recent OpenVINO, we don't care if the input is a constant node or a parameter node"). If it is not needed to check constantness, isn't it necessary to remove the whole "else" block?
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.
Sorry for my misunderstanding. The spaceToBatch and batchToSpace ops need to check constantness to support legacy for old_shape_infer. PR is updated.
0369736
to
915b1bb
Compare
Details:
Tickets: