Giter Site home page Giter Site logo

Comments (6)

apaszke avatar apaszke commented on April 27, 2024 1

Right. In new nn the only ones to fix are
in THCUNN:

  • MultiLabelMarginCriterion
  • MultiMarginCriterion
  • PReLU

and in Python:

  • CosineEmbeddingLoss
  • HingeEmbeddingLoss
  • MarginRankingLoss

from pytorch.

apaszke avatar apaszke commented on April 27, 2024

As a side note, this is a case only in legacy nn. New nn is just fine 😊

from pytorch.

fmassa avatar fmassa commented on April 27, 2024

A number of criterions still use .sum (), which calls sumall and returns a number. The THC interface might need to be changed to return a 1d tensor instead.

from pytorch.

fmassa avatar fmassa commented on April 27, 2024

Maybe a better workaround for the moment would be to replace the .sum() by tensor.view(-1).sum(1) ? We don't yet have tensor broadcasting and returning a 1d tensor in sumall / meanall / etc might be anoying for simple data processing (like subtracting the mean and dividing by the std).

from pytorch.

apaszke avatar apaszke commented on April 27, 2024

No, we should definitely leave tensor sumall/meanall as they are right now, but we should expose non-synchronizing alternatives (e.g. for use in autograd, where we never return a scalar). Good idea with view + sum. It might break for non-contiguous inputs, but I guess we don't care about these cases very much (as most modules don't accept them anyway).

from pytorch.

soumith avatar soumith commented on April 27, 2024

i dont think we should fix legacy-nn, i'm going to close this issue.

from pytorch.

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.