Skip to content

Commit

Permalink
pnnx convert torchaudio functional spectrogram
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Nov 21, 2024
1 parent 43a1b79 commit dd449c1
Show file tree
Hide file tree
Showing 6 changed files with 763 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/pnnx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ set(pnnx_pass_level2_SRCS

pass_level2/nn_quantized_FloatFunctional.cpp

pass_level2/torchaudio_F_spectrogram.cpp

pass_level2/nn_GRU.cpp
pass_level2/nn_LSTM.cpp
pass_level2/nn_RNN.cpp
Expand Down Expand Up @@ -587,6 +589,7 @@ set(pnnx_pass_ncnn_SRCS
pass_ncnn/torch_t.cpp
pass_ncnn/torch_transpose.cpp
pass_ncnn/torch_unsqueeze.cpp
pass_ncnn/torchaudio_F_spectrogram.cpp
pass_ncnn/torchvision_DeformConv2d.cpp
)

Expand Down
1 change: 1 addition & 0 deletions tools/pnnx/src/ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,7 @@ int Graph::python(const std::string& pypath, const std::string& pnnxbinpath)
fprintf(pyfp, "import torch.nn.functional as F\n");
fprintf(pyfp, "try:\n");
fprintf(pyfp, " import torchvision\n");
fprintf(pyfp, " import torchaudio\n");
fprintf(pyfp, "except:\n");
fprintf(pyfp, " pass\n");

Expand Down
Loading

0 comments on commit dd449c1

Please sign in to comment.