File: main.cpp

package info (click to toggle)
pytorch-audio 0.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,592 kB
  • sloc: python: 41,137; cpp: 8,016; sh: 3,538; makefile: 24
file content (22 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <torch/script.h>

int main(int argc, char* argv[]) {
  if (argc != 4) {
    std::cerr << "Usage: " << argv[0]
              << " <JIT_OBJECT> <INPUT_FILE> <OUTPUT_FILE>" << std::endl;
    return -1;
  }

  torch::jit::script::Module module;
  std::cout << "Loading module from: " << argv[1] << std::endl;
  try {
    module = torch::jit::load(argv[1]);
  } catch (const c10::Error& error) {
    std::cerr << "Failed to load the module:" << error.what() << std::endl;
    return -1;
  }

  std::cout << "Performing the process ..." << std::endl;
  module.forward({c10::IValue(argv[2]), c10::IValue(argv[3])});
  std::cout << "Done." << std::endl;
}