Comments (6)
Supporting Int only is okay/good b.c. that's what dims are represented
This is not a rule, e.g.:
julia> map(BigInt, 1:7)
1:7
julia> typeof(size(ans))
Tuple{BigInt}
from julia.
I want it to be public from base so folks don't have to re-implement it in packages.
Any examples of such implementations that folks had to reimplement?
from julia.
Any examples of such implementations that folks had to reimplement?
from julia.
It also turned out to be occasionally useful just inside base, if you grep a bit (it is roughly equivalent to reduce(checked_mul, dims)
, but with special handling of zeros and typemax to correct some edge cases of those), so I think it is reasonable to export. I know FSA decided to implement it differently for themselves, though that will be necessary for packages that want to support older versions anyways.
from julia.
IMO it would be a bit weird to export Core.checked_dims
, given that it's not generic and it's implementation is necessarily clumsy due to bootstrapping concerns.
FTR the function in FSA also supports just Int
, but it would be easy to make it generic.
from julia.
Any examples of such implementations that folks had to reimplement?
Yes, we'd need to make it a bit more generic and move it to Base. Possibly by defining Base.checked_dims(x...) = Core.checked_dims(Int.(x)...)
. Supporting Int only is okay/good b.c. that's what dims are represented/retrieved as, but auto-conversion is also reasonable.
from julia.
Related Issues (20)
- Confusing error when defining a method within nested testsets
- [FEATURE] Using Right Arrow Key to Auto Complete Virtual Text?
- should matrix-vector mul! also protect against aliasing? HOT 2
- code reports an error to line 0 HOT 6
- Average of Dates HOT 15
- safety consideration for operations with incompletely initialized types HOT 2
- Dimension check too restrictive in copytrito! and lacpy!
- LLVMPtr's address space annotation is lost with opaque pointers
- Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffad71a9977 -- gc_setmark_pool_ HOT 10
- confusing error thrown by `display` HOT 1
- Make `ScopedValues.get` a method of `Base.get` HOT 7
- Julia without libstdc++ HOT 8
- `--threads` option seems to now result in segfault in `jl_init_thread_heap` (`julia/src/gc.c:3992`) HOT 4
- `strings/annotated` test relies on that StyledStrings have been loaded HOT 1
- Not all `StridedArray`s follow the strided array API
- GC could do with more consolidated intro user documentation
- Stackoverflow without stacktrace when `convert`ing large tuple HOT 4
- `atexit()` finalizers should not run after encountering `SIGSEGV`
- `@code_llvm` with `debuginfo=:none` does not remove all debug info on Julia 1.11 HOT 4
- Conflation of UInt8 and Int8 in search functions
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 julia.