Skip to content

Commit

Permalink
Merge branch 'tnn2pnnx' of github.com:nihui/ncnn into tnn2pnnx
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Feb 10, 2025
2 parents 8dd6199 + 72b78d5 commit 86d25a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tools/pnnx/src/load_tnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ static size_t type_to_elemsize(int type)

static int get_tnn_tensor_type(int dt)
{
if (dt == 0) return 1;// fp32
if (dt == 1) return 3;// fp16
if (dt == 2) return 7;// int8
if (dt == 3) return 4;// int32
if (dt == 4) return 13;// bf16
if (dt == 0) return 1; // fp32
if (dt == 1) return 3; // fp16
if (dt == 2) return 7; // int8
if (dt == 3) return 4; // int32
if (dt == 4) return 13; // bf16

fprintf(stderr, "unsupported tnn tensor type %d\n", dt);
return 0; // unknown type
Expand Down
3 changes: 1 addition & 2 deletions tools/pnnx/src/pass_level2/torch_index_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ pnnx.Output output 1 0 out
{
indices[i] = p[i];
}
op_index->attrs["data"].type = 5;// i64
op_index->attrs["data"].type = 5; // i64
op_index->attrs["data"].shape = {n};
op_index->attrs["data"].data.resize(n * 8);
memcpy((void*)op_index->attrs["data"].data.data(), (const void*)indices.data(), n * 8);


Operator* op_gather = ops.at("select");
op_gather->params["dim"] = captured_params.at("dim");
op_gather->inputnames = {"input", "index"};
Expand Down

0 comments on commit 86d25a0

Please sign in to comment.