-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*FlatIterator
Support For ColMajor
#34
Labels
Comments
Merged
chewxy
added a commit
that referenced
this issue
Aug 19, 2018
# v0.9.0 # The changes made in this PR is aimed at better supporting v0.9.0 of Gorgonia itself. Along the way there are some new features and optimizations, as well as some bug fixes. The majority of the work in supporting v0.9.0 of Gorgonia is to shore up the underlying architecture to support CUDA related engines. This means moving more things to rely on `Engine` while keeping the engine interface overheads low. Additionally this also means better support for column major data layouts. * Heavier reliance on `Engine` for most functions. This allows for extensibility on the data structure. * Long standing bugbear - concepts of `RowVec` and `ColVec` has been removed (thanks to @matdodgson) - Touch points: `ap.go`, `iterator.go`, `iterator_mult.go`.`shape.go`, and the tests that were correct prior to this change have semantic meaning changes too. - **POTENTIAL TECH DEBT**: `iterator_mult.go` - the solution of filling with ones is a little too dodgy for my liking. The alternative would be to change `BroadcastStrides` which will change even more things (`Concat`, `Stack` etc) * **Optimization**: - `AP` has been depointerized in `*Dense` (thanks to @docmerlin). This reduces *some* amount of GC pointer chasing, but not all - allocation is slightly improved. (`(array).fromSliceOrArrayer`, `(array).fix()` and `(array).forcefix()` are part of the improvement around the logic of allocating data. * **Bug fixes**: - Fixes subtle errors in linear algebra functions. The result is a slightly longer function but easier to reason with. - Fixes some subtle bugs in `Concat` - see also gorgonia/gorgonia#218 - Fixed some small bugs with regards to `SampleIndex` that only show up when the slices have extreme lengths. This API should have been deprecated 2 years ago, but eh... it touched a lot of external projects. * **API changes**: - `Diag` is made available. Relies heavily on an `Engine`'s implementation - `NewFlatIterator` is unexported. - `NewAP` is unexported. - `MakeAP` is used instead. - `(Tensor).DataOrder()` is added to the definiiton of what a `Tensor` is. - `(Shape).IsScalarEquiv()` is a new method. This corresponds to the change of semantics of what a `Shape` should be. - `(Shape).CalcStrides()` is exported now. This enables users to correctly calculate strides that are consistent to what the package expects. - `(Shape).CalcStridesColMajor()` is exported as the method to calculate the strides of a Col-Major `*Dense`. * **New Interfaces**: - `NonStdEngine` is an `Engine that does not allocate using the default allocator. This allows for both embedding a `DefaultEngine` while overriding the allocation behaviour. - `Diager` - any engine that can return a tensor that only contains the diagonal values of the input - `NaNChecker` and `InfChecker` - engines that can check a tensor for NaN and Inf * **New Features**: * Added full support for colmajor tensors. (fixes #10) - TODO: colmajor iterator's prev() method (see #34) - Added serialization to Protobuf and Flatbuffers * TODO: Add example for serialization (see #35 and #36) - Added more support for sparse CS tensors. * **New Subpackages**: * `native` is a subpackage that essentially gives users a native, Go-based iterator. Basically the ability to go from a `*Dense` to a `[][]T` or `[][][]T` **without extra allocations** (for the data). This was pulled into `master` earlier, but as of v0.9.0, the generic version is available too. * **Semantic Changes**: - `Shape` has semantic changes regarding whether or not a shape is scalar. A scalar shape is defined to be `Shape{}` or `Shape{1}` only. Formerly, `Shape{1,1}` was also considered to be scalar. Now they're considered to be `ScalarEquivalent` (along with `Shape{1, 1, .... , 1}`) - A `Dtype` that is is orderable is also now comparable for equality. If `RegisterOrd` is called with a new `Dtype`, it is also automatically registered as `Eq`. * **Cosmetic Changes**: - README has been updated to point to correct doc pages
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
*FlatIterator
type implementsIterator
, which is an interface for stateful iterators. It also supports reverse iteration (by means of the.SetReverse()
method).Currently, the
*FlatIterator
type supports the following operationsNext()
Next()
NextValidity()
NextValidity()
NextValid()
NextValid()
NextInvalid()
NextInvalid()
A major internal method that underpins all of these are
.ndNext()
and.ndPrevious()
. The corresponding col-major version are.colMajorNDnext()
and.colMajorNDPrevious()
..colMajorNDPrevious()
is not implemented. It can be found at Line 402 ofiterator.go
The text was updated successfully, but these errors were encountered: