Skip to content
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

[Improvement] suppress onnx optimizer warning #1593

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class SubgraphMatcher::SubgraphMatcherImpl {
std::unordered_map<const Node*, Node*> nodes_map_;
std::unordered_map<const Value*, Value*> values_map_;

const MatchAttribute match_attribute_;
const Graph& pattern_;
const MatchAttribute match_attribute_;
const Node* anchor_ = nullptr;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ using torch::jit::HashNode;
using torch::jit::Node;
using torch::jit::Value;

struct EqualNodeWithParams {
EqualNodeWithParams(std::unordered_map<std::string, Tensor>& params) : params_(params) {}

bool operator()(const Node* lhs, const Node* rhs) const {
auto lhs_inputs = lhs->inputs();
auto rhs_inputs = rhs->inputs();
}

private:
std::unordered_map<std::string, Tensor>& params_;
};

struct CommonSubexpressionEliminator {
using ParamMapType = std::unordered_map<std::string, std::pair<Tensor, Value*>>;
CommonSubexpressionEliminator(std::shared_ptr<Graph> graph,
Expand Down Expand Up @@ -100,7 +88,6 @@ struct CommonSubexpressionEliminator {

// Check for CSE opportunities in the parent block.
auto parent_lookup = parent_lookup_fn(node);
auto g_out = node->owningGraph()->outputs();
if (parent_lookup != nullptr) {
changed = true;
node->replaceAllUsesWith(parent_lookup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ bool FuseSelectAssign(Node* node, std::unordered_map<std::string, Tensor>& param

void FuseSelectAssign(Block* block, std::unordered_map<std::string, Tensor>& params,
std::unordered_map<std::string, Value*>& vmap, SubgraphMatcher& matcher) {
auto graph = block->owningGraph();
auto it = block->nodes().begin();
while (it != block->nodes().end()) {
auto node = *it;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ void MergeShapeConcate(Node* node) {
}

void MergeShapeConcate(Block* block) {
auto graph = block->owningGraph();
auto it = block->nodes().begin();
while (it != block->nodes().end()) {
auto node = *it;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void RemoveRedundantCast(Node* node) {
}

void ONNXPeephole(Block* block) {
auto graph = block->owningGraph();
auto it = block->nodes().begin();
while (it != block->nodes().end()) {
auto node = *it;
Expand Down