Skip to content

Commit

Permalink
suppress onnx optimizer warning (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
grimoire authored Jan 19, 2023
1 parent 7e48fb2 commit 8a050f1
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 17 deletions.
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

0 comments on commit 8a050f1

Please sign in to comment.