Skip to content

Commit

Permalink
1. Fix bug of fold constants sub graph pass in pass level5
Browse files Browse the repository at this point in the history
  • Loading branch information
sen.li committed Jul 25, 2024
1 parent 1c24d7a commit d2f190a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion tools/pnnx/Releasenotes
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@ dev.1.0.26.20240723
2. Add fold constants sub graph pass in pass level5
3. Add trans unbind2squeeze pass in pass level6
4. Fix tensor.fill
5. Fix torch.unbind
5. Fix torch.unbind

dev.1.0.27.20240725
1. Fix bug of fold constants sub graph pass in pass level5
3 changes: 2 additions & 1 deletion tools/pnnx/src/pass_level5/fold_constants_sub_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void fold_constants_sub_graph(std::shared_ptr<pnnx::Graph> graph)
{
if(consumer->label == "")
{
consumer->label = "main";
main_node_list.push(consumer);
}
}
Expand All @@ -66,7 +67,6 @@ void fold_constants_sub_graph(std::shared_ptr<pnnx::Graph> graph)
{
Operator* cur_node = main_node_list.front();
main_node_list.pop();
cur_node->label = "main";
std::vector<Operand*> output_operands = cur_node->outputs;
for(auto out: output_operands)
{
Expand All @@ -75,6 +75,7 @@ void fold_constants_sub_graph(std::shared_ptr<pnnx::Graph> graph)
{
if(consumer->label == "")
{
consumer->label = "main";
main_node_list.push(consumer);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/pnnx/src/pass_level6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void pass_level6(std::shared_ptr<pnnx::Graph> g, const std::set<std::string>& fo

trans_TensorTypeAs2TensorTo(g);
fprintf(stderr, "############# finish trans_TensorTypeAs2TensorTo\n");
trans_Unbind2Squeeze(g);
trans_Unbind2Squeeze(g);
fprintf(stderr, "############# finish trans_Unbind2Squeeze\n");
}

Expand Down
2 changes: 1 addition & 1 deletion tools/pnnx/src/py_proj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// #include <torch/extension.h>
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
#define MYLIBRARY_VERSION "dev.1.0.26.20240716"
#define MYLIBRARY_VERSION "dev.1.0.27.20240725"
using namespace pnnx_graph;
using namespace pnnx_ir;
namespace py = pybind11;
Expand Down

0 comments on commit d2f190a

Please sign in to comment.