Coder Social home page Coder Social logo

Comments (5)

JoeLoser avatar JoeLoser commented on June 20, 2024

Agreed. As seen in the LLVM docs, only FP types are accepted. I just added a use of constrained in this function so you get a slightly nicer error message — at least explaining that only FP types are permitted.

from mojo.

soraros avatar soraros commented on June 20, 2024

@JoeLoser come think about it, copysigndoes seem to have well defined meaning for integer types, and are quite convenient in generic code. Maybe we should have implementation for them as well, just not lowered into a single LLVM intrinsic.

from mojo.

JoeLoser avatar JoeLoser commented on June 20, 2024

@JoeLoser come think about it, copysigndoes seem to have well defined meaning for integer types, and are quite convenient in generic code. Maybe we should have implementation for them as well, just not lowered into a single LLVM intrinsic.

Ha, funny that you mention that. I just reworked the PR a few minutes ago to define it for integral types too with the same rationale. :)

from mojo.

soraros avatar soraros commented on June 20, 2024

@JoeLoser Lol! For signed types only or both? What about booleans? How was zero treated? Maybe having to answer these questions is why they are not generally available (not in NumPy or PyTorch even, I just checked). I feel very conflicted right now.

from mojo.

gryznar avatar gryznar commented on June 20, 2024

btw, why not copy_sign to align naming?

from mojo.

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.