From e71fdf8e51033048da4d59e1bb8dabdc334f09e4 Mon Sep 17 00:00:00 2001 From: nihui Date: Thu, 7 Nov 2024 10:27:11 +0800 Subject: [PATCH] pnnx write implicit int conversion in python script (#5767) --- .ci/pnnx.yml | 4 ++-- tools/pnnx/src/ir.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/pnnx.yml b/.ci/pnnx.yml index 207d78c4e..a08379ff8 100644 --- a/.ci/pnnx.yml +++ b/.ci/pnnx.yml @@ -200,8 +200,8 @@ jobs: export OMP_NUM_THREADS=1 export MKL_NUM_THREADS=1 export MKL_ENABLE_INSTRUCTIONS=SSE4_2 - cd tools/pnnx - cd build && ctest --output-on-failure -j 16 + cd tools/pnnx/build + ctest --output-on-failure -j 16 - name: python-pnnx run: | diff --git a/tools/pnnx/src/ir.cpp b/tools/pnnx/src/ir.cpp index a0eb8d692..9e616699a 100644 --- a/tools/pnnx/src/ir.cpp +++ b/tools/pnnx/src/ir.cpp @@ -1051,7 +1051,7 @@ static std::string expand_expression(const Operator* op) || t == "torch.long") { std::string unaryop = t; - if (t == "int") unaryop = "int"; + if (t == "int") unaryop = ""; // but the explicit int() causes troubles in tracing if (t == "abs") unaryop = "torch.abs"; if (t == "acos") unaryop = "torch.acos"; if (t == "acosh") unaryop = "torch.acosh";