You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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
Package `tensor` is a package that provides efficient, generic (by some definitions of generic) n-dimensional arrays in Go. Also in this package are functions and methods that are used commonly in arithmetic, comparison and linear algebra operations.
3
4
4
-
The main purpose of this package is to support the operations required by [Gorgonia](https://github.com/chewxy/gorgonia).
5
+
The main purpose of this package is to support the operations required by [Gorgonia](https://gorgonia.org/gorgonia).
5
6
6
7
## Introduction ##
7
8
In the data analysis world, [Numpy](http://http://www.numpy.org/) and [Matlab](https://www.mathworks.com/products/matlab.html) currently reign supreme. Both tools rely heavily on having performant n-dimensional arrays, or tensors. **There is an obvious need for multidimensional arrays in Go**.
@@ -50,15 +51,15 @@ The `*Dense` tensor is the primary tensor and is represented by a singular flat
50
51
51
52
### Compressed Sparse Column Matrix ###
52
53
53
-
Coming soon
54
+
Documentation Coming soon
54
55
55
56
### Compressed Sparse Row Matrix ###
56
57
57
-
Coming soon
58
+
Documentation Coming soon
58
59
59
60
## Usage ##
60
61
61
-
To install: `go get -u "github.com/chewxy/gorgonia/tensor"`
62
+
To install: `go get -u "gorgonia.org/tensor"`
62
63
63
64
To create a matrix with package `tensor` is easy:
64
65
@@ -129,7 +130,7 @@ b.SetAt(1000, 0, 1, 2)
129
130
fmt.Printf("b:\n%v", b)
130
131
```
131
132
132
-
There is a whole laundry list of methods and functions available at the [godoc](https://godoc.org/github.com/chewxy/gorgonia/tensor) page
133
+
There is a whole laundry list of methods and functions available at the [godoc](https://godoc.org/gorgonia.org/tensor) page
133
134
134
135
135
136
@@ -198,7 +199,7 @@ The above call will use `myEngine` to allocate memory instead. This is useful in
198
199
199
200
### Other failed designs ###
200
201
201
-
The alternative designs can be seen in the [ALTERNATIVE DESIGNS document](https://github.com/chewxy/gorgonia/blob/master/tensor/ALTERNATIVEDESIGNS.md)
202
+
The alternative designs can be seen in the [ALTERNATIVE DESIGNS document](https://github.com/tensor/blob/master/ALTERNATIVEDESIGNS.md)
0 commit comments