Giter Site home page Giter Site logo

Comments (4)

hughperkins avatar hughperkins commented on June 10, 2024

Lua errors are more consistent, and easier to maintain. Since they provide a stack-trace, it's fairly easy to diagnose them.

from cunn.

dominikgrewe avatar dominikgrewe commented on June 10, 2024

I feel like in practice the caller of pointwiseApply simply reports an error with CUTORCH_DIM_WARNING, so maybe pointwiseApply actually has more information on what went wrong. Ideally we'd combine the two, but I guess we don't have a good mechanism for that.

So I'd also be in favour of Lua errors.

from cunn.

wickedfoo avatar wickedfoo commented on June 10, 2024

Ah, actually from what I recall when writing it the intent was that the API shouldn't depend upon running in a Lua interpreter, but that battle (having a tensor manipulation API that could be used outside of a Lua environment) was lost in Torch a long time ago.

The only specific information that the caller has is the arguments passed to the function, and what index they were. But it's quite ambiguous when there are 2+ arguments, the DIM_WARNING error doesn't say anything at all about size mismatch, and returning more error status to indicate exactly what argument it didn't like and why it didn't like it is just as fragile as the current situation.

I think I'll just add the Lua error throwing in the pointwiseApply* functions for specific failure cases, and remove the retval checking in cutorch itself.

from cunn.

dominikgrewe avatar dominikgrewe commented on June 10, 2024

I suppose you can use THError to not be Lua-specific.

from cunn.

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.