A good place to look for code examples is GitHub. For instance, I found this implementation of CP-ALS by just searching for the terms "tensor decomposition" in GitHub's search-box function (it was on page 3).
I am not familiar with Alternating Least Squares, let alone the tensor version of it, so I cannot vouch for the accuracy or correctness of the linked code. I think it's a good starting point. At the very least, this is a way for you to find some reference implementations of your algorithm.