Comments (2)
Fundamentally, I like a[{0, 7}]
. I don't think it necessarily conflicts with a[100]
since those can be disambiguated by the arg type, though one may have to be careful that there's no ambiguity with implicit conversions.
For now, I'd only support the sarray index to be of length == expr_dimension(E)
that it's being passed to, so all it really does is unpack and pass things through to the multi-arg operator()
.
I'm not sure that linear indexing via something like a[100]
is desirable to have (in the public interface). I'd say if one wants to have a flattened view, that'd better be supported by something like ravel
or flatten
. In terms of a cheap way to iterate over all values, one should probably provide iterators instead of some (seemingly) linear access.
On the data layout, I think it's another issue that will probably require some thought. Fundamentally, gtensor and gtensor_view use an array of strides, so the underlying data can be row-major or column-major or whatever, and access will work. I guess you can make a row-major gtensor right now using swapaxis
. But I also think it's true that in some select places (other than the initial initialization of the strides) there is an assumption of col-major, ie., some expression stuff may break, and that should be handled properly, though I also think I remember some non-trivial obstacles to that...
from gtensor.
Closed by #62 and #56. Implements the simplest form, in particular operator[] only supports shape types, not literal arrays. Linear access is handled via the flatten
view helper.
from gtensor.
Related Issues (20)
- gtblas: Inconsistent stream in C API when using getrs / getrs_banded HOT 6
- hip: thrust backend does asynchronous array zeroing on gtensor construct HOT 5
- consistent size and index types HOT 7
- improve C API for streams
- cgtblas: sycl backend does not handle nullptr case HOT 3
- sycl: use complex extension
- fortran: add cmake option for complex/real sizes
- fortran: rocm does not find ISO_Fortran_binding.h header HOT 2
- clib namespace is confusing HOT 1
- device debug print helper HOT 1
- more CI checks: ASan, UBSan, clang-tidy HOT 2
- missing return statement warning
- cmake: use official ROCm and oneAPI integration
- ci: update clang-format version HOT 8
- spack package, e4s integration, release
- alternate fft backends
- micro benchmarking assign expressions on all platforms
- improve caching allocator
- const stream objects HOT 2
- half precision support
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 gtensor.