Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/facebookarchive/thpp
TH++, C++ interface to the torch7 TH library
https://github.com/facebookarchive/thpp
Last synced: 17 days ago
JSON representation
TH++, C++ interface to the torch7 TH library
- Host: GitHub
- URL: https://github.com/facebookarchive/thpp
- Owner: facebookarchive
- License: other
- Archived: true
- Created: 2014-06-20T23:09:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-28T09:08:55.000Z (over 6 years ago)
- Last Synced: 2024-08-05T02:01:21.628Z (3 months ago)
- Language: C++
- Size: 133 KB
- Stars: 236
- Watchers: 39
- Forks: 110
- Open Issues: 43
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# TH++: A C++ tensor library
TH++ is a C++ tensor library, implemented as a wrapper around the
[TH library](https://github.com/torch/torch7/tree/master/lib/TH) (the low-level
tensor library in [Torch](http://torch.ch/)). There is unfortunately little
documentation about TH, but the interface mimics the Lua
[Tensor](https://github.com/torch/torch7/blob/master/doc/tensor.md) interface.The core of the library is the `Tensor` class template, where `T` is a
numeric type (usually floating point, `float` or `double`). A tensor is
a multi-dimensional array, usually in C (row-major) order, but many
operations (transpose, slice, etc) are performed by permuting indexes and
changing offsets, so the data is no longer contiguous / in row-major order.
Read the [numpy.ndarray
documentation](http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html)
for more details about the strided indexing scheme.Tensors may also share memory with other tensors; operations that manipulate
metadata (select, slice, transpose, etc) will make the destination tensor
share memory with the source. To ensure you have a unique copy, call
`force(Tensor::UNIQUE)` on the tensor. Similarly, to ensure you have
a contiguous C (row-major) tensor, call `force(Tensor::CONTIGUOUS)`, which
may also create a unique copy.Please see the header file `` for more details.