Git Product home page Git Product logo

Comments (3)

bddppq avatar bddppq commented on August 23, 2024

Here are my thoughts:

  • native function: yep and it's a must, because all operators are defined at this level and some of them not exposed in the next two levels. e.g. non "nn" ops, custom ops
  • nn functional: nice to have and we should do it, the binding can save us a lot of works of reimplementing the logic with native functions in go.
  • nn.module: nice to have but it's probably hard, because we need to make sure they interact well with go level torch.Module. e.g. In a model with mixed c++ module (exposed through the binding) and go torch.Module, how do we serialize them? if a c++ module takes another module as input (e.g. Sequential), how can we pass a go torch.Module to c++?

from gotorch.

wangkuiyi avatar wangkuiyi commented on August 23, 2024

Thanks for all the kindly reminders and suggestions! @bddppq

BTW, is it that

  1. nn.module and nn.functional are all based on nn.function?
  2. is https://github.com/pytorch/xla an alternative implementation of nn.function?

If so, is that we can have gotorch.nn and gotorch.nn.functional just like PyTorch, as long as they all call native functions, and in the future, we can simply replace the implementation of native functions to use https://github.com/pytorch/xla?

from gotorch.

wangkuiyi avatar wangkuiyi commented on August 23, 2024

We are now clear that we need to migrate three layers from PyTroch to GoTorch:

  1. native functions: https://github.com/wangkuiyi/gotorch/blob/develop/doc/wrap_native_functions.md
  2. Functionals in torch.nn.functional and Modules in torch.nn : https://github.com/wangkuiyi/gotorch/blob/develop/doc/develop_functionals_and_modules.md

from gotorch.

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.