Skip to content

Commit

Permalink
[GPU] fix Transpose issue for ConvertColor with FakeQuantize. (#12645) (
Browse files Browse the repository at this point in the history
#12761)

Co-authored-by: Tang Wei <[email protected]>
Co-authored-by: Kurt Chen <[email protected]>
  • Loading branch information
3 people committed Aug 26, 2022
1 parent abaa9e6 commit 41a404f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugins/intel_gpu/src/plugin/ops/transpose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ static void CreateTransposeOp(Program& p, const std::shared_ptr<ngraph::op::v1::
// Handle Transpose operation related to ConvertColor operation:
// In case of ConvertColor operation we have NHWC (byxf) input format which should be converted to
// NCHW (bfyx) by this Permute, so we replace Permute with Reorder (to bfyx) primitve
auto input = op->get_input_node_shared_ptr(0);
if (is_convert_color_type(input) && order == std::vector<uint16_t>{0, 3, 1, 2}) {
auto input = op->get_input_size() > 0 ? op->get_input_node_shared_ptr(0) : nullptr;
// Handle the case ConvertColor -> FakeQuantize -> Permute
auto input1 = input ? (input->get_input_size() > 0 ? input->get_input_node_shared_ptr(0) : nullptr) : nullptr;
if (((input && is_convert_color_type(input)) || (input1 && is_convert_color_type(input1)))
&& order == std::vector<uint16_t>{0, 3, 1, 2}) {
auto precision = input->get_element_type();
p.AddPrimitive(cldnn::reorder(layerName,
inputPrimitives[0],
Expand Down

0 comments on commit 41a404f

Please sign in to comment.