Giter Site home page Giter Site logo

对于控制流算子的支持 about mnn HOT 4 OPEN

stricklandye avatar stricklandye commented on June 3, 2024
对于控制流算子的支持

from mnn.

Comments (4)

jxt1234 avatar jxt1234 commented on June 3, 2024
  1. switch_case 一般可以用 if 替代,你可以上传一个简单模型,我们排期支持下
  2. 存在控制流算子 (if / while) 时,都会产生子图
  3. 这个你可以把各分支分别导出 pb 并转 mnn 模型来实现。不过建议还是换成 if ,加载1个mnn比较方便

from mnn.

johnjim0816 avatar johnjim0816 commented on June 3, 2024
  1. switch_case 一般可以用 if 替代,你可以上传一个简单模型,我们排期支持下
  2. 存在控制流算子 (if / while) 时,都会产生子图
  3. 这个你可以把各分支分别导出 pb 并转 mnn 模型来实现。不过建议还是换成 if ,加载1个mnn比较方便

if else在推理的时候不会很慢吗,如果是一定批量输入的话

from mnn.

jxt1234 avatar jxt1234 commented on June 3, 2024

批量输入建议不要用控制流的方式实现,可以用 select 类似的算子替代

from mnn.

johnjim0816 avatar johnjim0816 commented on June 3, 2024

批量输入建议不要用控制流的方式实现,可以用 select 类似的算子替代

那如果是MoE这类网络呢,有什么比较好的方式,select 类似的算子在MoE场景中似乎也会回到tf.case的问题上

from mnn.

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.