Skip to content

Commit

Permalink
1. set torch.arange node to attribute_node_list in fold_constants_sub…
Browse files Browse the repository at this point in the history
…_graph pass
  • Loading branch information
sen.li committed Jul 30, 2024
1 parent d2f190a commit 9660d68
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion tools/pnnx/Releasenotes
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,7 @@ dev.1.0.26.20240723
5. Fix torch.unbind

dev.1.0.27.20240725
1. Fix bug of fold constants sub graph pass in pass level5
1. Fix bug of fold constants sub graph pass in pass level5

dev.1.0.28.20240730
1. set torch.arange node to attribute_node_list in fold_constants_sub_graph pass
9 changes: 5 additions & 4 deletions tools/pnnx/src/pass_level5/fold_constants_sub_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ void fold_constants_sub_graph(std::shared_ptr<pnnx::Graph> graph)
for(size_t i = 0; i < graph->ops.size(); i++)
{
Operator* cur_op = graph->ops[i];
if (cur_op->type == "pnnx.Attribute")
if (cur_op->type == "pnnx.Input")
{
attribute_node_list.push(cur_op);
input_node_list.push(cur_op);
}
else if(cur_op->type == "pnnx.Input" || cur_op->inputs.size() == 0)
else if(cur_op->type == "pnnx.Attribute" || cur_op->inputs.size() == 0)
{
input_node_list.push(cur_op);

attribute_node_list.push(cur_op);
}
}

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.27.20240725"
#define MYLIBRARY_VERSION "dev.1.0.28.20240730"
using namespace pnnx_graph;
using namespace pnnx_ir;
namespace py = pybind11;
Expand Down

0 comments on commit 9660d68

Please sign in to comment.