Giter VIP home page Giter VIP logo

Comments (1)

yeomko22 avatar yeomko22 commented on July 29, 2024

trace, script

  • torchscript를 생성하는 방법으로는 trace와 script가 있다.
  • trace의 경우 예시 인풋을 하나 넣어주고, 여기서 발생하는 연산을 추적해서 torchscript를 생성한다.
  • 이 경우, 인풋 값에 따라 분기 문을 처리하는 control-flow를 torchscript에 반영하지 못한다.
  • 만일 control-flow 반영이 필요할 경우에는 명시적으로 annotation을 달아서 torchscript compiler에게 전달해주는 script 기법을 사용해야 한다.

모델 직렬화, 파일로 저장

traced_script_module.save("traced_resnet_model.pt")
  • 간단하게 save 메서드 호출만으로 torchscript를 직렬화 하여 파일로 저장이 가능하다.

from til.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.