Skip to content

Commit 41a404f

Browse files
sshlyapnwei1tangikurtchen
authored
[GPU] fix Transpose issue for ConvertColor with FakeQuantize. (#12645) (#12761)
Co-authored-by: Tang Wei <wei1.tang@intel.com> Co-authored-by: Kurt Chen <kurt.chen@intel.com>
1 parent abaa9e6 commit 41a404f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/plugins/intel_gpu/src/plugin/ops/transpose.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ static void CreateTransposeOp(Program& p, const std::shared_ptr<ngraph::op::v1::
4646
// Handle Transpose operation related to ConvertColor operation:
4747
// In case of ConvertColor operation we have NHWC (byxf) input format which should be converted to
4848
// NCHW (bfyx) by this Permute, so we replace Permute with Reorder (to bfyx) primitve
49-
auto input = op->get_input_node_shared_ptr(0);
50-
if (is_convert_color_type(input) && order == std::vector<uint16_t>{0, 3, 1, 2}) {
49+
auto input = op->get_input_size() > 0 ? op->get_input_node_shared_ptr(0) : nullptr;
50+
// Handle the case ConvertColor -> FakeQuantize -> Permute
51+
auto input1 = input ? (input->get_input_size() > 0 ? input->get_input_node_shared_ptr(0) : nullptr) : nullptr;
52+
if (((input && is_convert_color_type(input)) || (input1 && is_convert_color_type(input1)))
53+
&& order == std::vector<uint16_t>{0, 3, 1, 2}) {
5154
auto precision = input->get_element_type();
5255
p.AddPrimitive(cldnn::reorder(layerName,
5356
inputPrimitives[0],

0 commit comments

Comments
 (0)