Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bassoy committed Mar 8, 2024
1 parent b0307c5 commit 4288a80
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ Please have a look at the [wiki](https://github.com/bassoy/ttm/wiki) page for mo
* Requires the tensor elements to be contiguously stored in memory.
* Element types must be an arithmetic type suporting multiplication and addition operator

## Example
## Python Example
```python
import numpy as np
import ttmpy as tp

A = np.arange(4*3*2, dtype=np.float64).reshape(4,3,2)
B = np.arange(5*4, dtype=np.float64).reshape(5,4)
C = tp.ttm(1,A,B)
D = np.einsum("ijk,xi->xjk", A, B)
np.all(np.equal(C,D))
```

## C++ Example
```cpp
/*main.cpp*/
#include <tlib/ttm.h>
Expand Down

0 comments on commit 4288a80

Please sign in to comment.