Skip to content

Commit

Permalink
Merge branch 'master' into as/npuw_parallel_for_improve
Browse files Browse the repository at this point in the history
  • Loading branch information
smirnov-alexey authored Oct 3, 2024
2 parents 9892b50 + 108bb73 commit b9efe9c
Show file tree
Hide file tree
Showing 15 changed files with 2,184 additions and 539 deletions.
30 changes: 29 additions & 1 deletion src/frontends/tensorflow_common/src/op/expand_dims.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
//

#include "common_op_table.hpp"
#include "helper_ops/complex_type_mark.hpp"
#include "openvino/op/constant.hpp"
#include "openvino/op/less.hpp"
#include "openvino/op/select.hpp"
#include "openvino/op/subtract.hpp"
#include "openvino/op/unsqueeze.hpp"
#include "utils.hpp"

using namespace std;
using namespace ov::op;
Expand All @@ -14,9 +20,31 @@ namespace tensorflow {
namespace op {

OutputVector translate_expand_dims_op(const NodeContext& node) {
default_op_checks(node, 2, {"ExpandDims", "EXPAND_DIMS"});
default_op_checks(node, 2, {"ExpandDims", "EXPAND_DIMS"}, true);
auto input = node.get_input(0);
auto axis = node.get_input(1);
auto complex_type_mark = as_type_ptr<ComplexTypeMark>(input.get_node_shared_ptr());

if (complex_type_mark) {
element::Type complex_part_type = complex_type_mark->get_complex_part_type();
input = complex_type_mark->input_value(0);

auto const_zero = create_same_type_const_scalar<int32_t>(axis, 0);

auto is_axis_neg = make_shared<v1::Less>(axis, const_zero);

auto const_one = create_same_type_const_scalar<int32_t>(axis, 1);
auto axis_min_one = make_shared<v1::Subtract>(axis, const_one);

auto new_axis = make_shared<v1::Select>(is_axis_neg, axis_min_one, axis);

auto unsqueeze = make_shared<v0::Unsqueeze>(input, new_axis);

set_node_name(node.get_name(), unsqueeze);
auto complex_result = make_shared<ComplexTypeMark>(unsqueeze, complex_part_type);
return {complex_result};
}

auto unsqueeze = make_shared<v0::Unsqueeze>(input, axis);
set_node_name(node.get_name(), unsqueeze);
return {unsqueeze};
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

#pragma once

#include "openvino/runtime/threading/cpu_streams_executor.hpp"
#include "openvino/runtime/threading/istreams_executor.hpp"

#include "intel_gpu/graph/topology.hpp"
#include "intel_gpu/graph/program.hpp"
#include "intel_gpu/graph/serialization/binary_buffer.hpp"
#include "intel_gpu/runtime/compounds.hpp"
#include "intel_gpu/runtime/memory.hpp"
#include "intel_gpu/runtime/engine.hpp"
#include "intel_gpu/runtime/event.hpp"
#include "intel_gpu/runtime/stream.hpp"
#include "intel_gpu/runtime/lru_cache.hpp"
#include "intel_gpu/runtime/shape_predictor.hpp"
#include "intel_gpu/plugin/variable_state.hpp"

Expand Down Expand Up @@ -211,7 +209,7 @@ struct network {
bool is_dynamic() const { return _is_dynamic; }
size_t get_weights_cache_capacity() const { return _weights_cache_capacity; }

memory_pool& get_memory_pool() {
memory_pool& get_memory_pool() const {
return *_memory_pool;
}

Expand Down Expand Up @@ -284,7 +282,9 @@ struct network {
void dump_memory_pool(std::string dump_path, int64_t curr_iter);

#ifdef GPU_DEBUG_CONFIG
int64_t iteration = 0;
mutable int64_t iteration = 0;
friend class NetworkDebugHelper;
friend class NodeDebugHelper;
#endif
};
} // namespace cldnn
Loading

0 comments on commit b9efe9c

Please sign in to comment.