Comments (5)
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.
@JoeLoser come think about it, copysign
does 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 come think about it,
copysign
does 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.
@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.
btw, why not copy_sign
to align naming?
from mojo.
Related Issues (20)
- [Modular CLI] install modular command tool without require root permissions HOT 4
- [BUG] crash when first trying to debug a mojo app in VSCode using WSL VS Code Server: "free(): invalid pointer"
- [Feature Request] Merge `init_pointee_move` and `move_pointee_into`.
- [BUG] trouble reading a file HOT 2
- [BUG] rounding error with UInt32 HOT 2
- [Feature Request] A `Type[AnyStruct | AnyClass | etc]` operator that returns the type's interface (as a trait)
- [BUG] Sneaky ternary operator bugs
- [BUG] Varaint Types using function types Don't Allow Parameters When calling the function.
- [BUG] Values get set to 1 when passing one Scalar into another Scalar's constructor HOT 3
- [BUG] crash when passing offset DTypePointer into Tensor
- [BUG] Unsigned integer casting overflowing as if signed when using `int()` or `UInt32()` HOT 5
- [BUG] modular: error: failed to run script
- Implement arithmetic operators for `UInt`
- [BUG] math/numeric functions weird behavior with float16 types HOT 5
- [BUG] question about writing to file
- [BUG] Cannot materialize a capturing closure
- [Docs] the "random" module should not be imported by default HOT 2
- [BUG] Index out of bound with nested list literals
- [Feature Request] Allow __get_item__ calls to use a mix of colon slices and integers
- [BUG] Program Crash on generating simple data. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mojo.