# Tensor decompositions in Julia

**URL:** https://discourse.julialang.org/t/tensor-decompositions-in-julia/112937
**Category:** General Usage
**Tags:** question
**Created:** [April 14, 2024, 9:29pm UTC](https://discourse.julialang.org/t/tensor-decompositions-in-julia/112937 "2024-04-14T21:29:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![00krishna](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00krishna/32/8843_2.png) [@00krishna](https://discourse.julialang.org/u/00krishna)
#### Post date: [April 14, 2024, 9:29pm UTC](https://discourse.julialang.org/t/tensor-decompositions-in-julia/112937/1 "2024-04-14T21:29:43Z")

</div>

I was wondering if there is a package for tensor decomposition was in Julia–hopefully the package is differentiable as well for ML. I am talking about CP-decompositions and Tucker decompositions to start. I actually would like to try some tensor regression as well. I was thinking of something akin to the `Tensorly` project in python if that helps.

I found a few posts on this topic, but they are pretty old.

One user used the [`TensorDecompositions.jl`](https://github.com/yunjhongwu/TensorDecompositions.jl) package, but that has not been updated in 6 years.

> [@Low rank tensor computation](https://discourse.julialang.org/t/low-rank-tensor-computation/93627):
>
> I want to generate a rank-1 tensor with Julia for some tensor decomposition. As for SVD and linear combination of singular values and orthogonal basis vectors, one can decompose a matrix by a sum like the sum of singular values \* u \* v’. I can generate a 10x20x30 matrix like this. (the original code is inspired by [GitHub - yunjhongwu/TensorDecompositions.jl: A Julia implementation of tensor decomposition algorithms](https://github.com/yunjhongwu/TensorDecompositions.jl)) u = randn(10); v = randn(20); w = randn(30) # Generate a noisy rank-1 tensor…

`Tullio.jl` seems good, but then it seems I would need to code the tensor decomposition myself. That is fine, but since I am new to tensor decompositions it would be nice to have a reference implementation to compare against.

Finally, the `TensorOperations.jl` package indicates that it is for tensor contractions-similar to `Tullio`, however I did not see any reference to tensor decomposition, etc.

---

<div class="post-metadata">

### Author: ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)
#### Post date: [March 17, 2025, 5:56pm UTC](https://discourse.julialang.org/t/tensor-decompositions-in-julia/112937/2 "2025-03-17T17:56:34Z")

</div>

Did you ever code anything up for this? I would also be interested in Tucker and CP decompositions…
