Skip to content

Commit

Permalink
[GPU] Set preferred format of gather to dep(0)'s output
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinchoi-intel committed Jun 14, 2023
1 parent b023119 commit dc496b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/intel_gpu/src/graph/layout_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "resample_inst.h"
#include "reshape_inst.h"
#include "arg_max_min_inst.h"
#include "gather_inst.h"
#include "shape_of_inst.h"
#include <sstream>

Expand Down Expand Up @@ -1596,9 +1597,10 @@ format layout_optimizer::get_preferred_format(program_node& node) {
bool allow_new_shape_infer = node.get_program().get_config().get_property(ov::intel_gpu::allow_new_shape_infer);

if (allow_new_shape_infer) {
if (node.is_type<shape_of>())
if (node.is_type<shape_of>() ||
node.is_type<gather>()) {
return format::get_default_format(node.get_dependency(0).get_output_layout(false).get_rank());

}
// Let reorder_input pass to check input format instead of output_format in forward investigation, vice versa
auto out_lay_rank = node.get_output_layout(false).get_rank();
auto dep_size = node.get_dependencies().size();
Expand Down

0 comments on commit dc496b2

Please sign in to comment.