Robert beat me to it on einsum, but also check tensordot for general tensor contraction.



On Fri, Jan 15, 2016 at 9:30 AM, Nathaniel Smith <njs@pobox.com> wrote:

On Jan 15, 2016 8:36 AM, "Li Jiajia" <jiajiali@gatech.edu> wrote:
>
> Hi all,
> I’m a PhD student in Georgia Tech. Recently, we’re working on a survey paper about tensor algorithms: basic tensor operations, tensor decomposition and some tensor applications. We are making a table to compare the capabilities of different software and planning to include NumPy. We’d like to make sure these parameters are correct to make a fair compare. Although we have looked into the related documents, please help us to confirm these. Besides, if you think there are more features of your software and a more preferred citation, please let us know. We’ll consider to update them. We want to show NumPy supports tensors, and we also include "scikit-tensor” in our survey, which is based on NumPy.
> Please let me know any confusion or any advice! 
> Thanks a lot! :-)
>
> Notice: 
> 1. “YES/NO” to show whether or not the software supports the operation or has the feature.
> 2. “?” means we’re not sure of the feature, and please help us out. 
> 3. “Tensor order” means the maximum number of tensor dimensions that users can do with this software. 
> 4. For computational cores, 
> 1) "Element-wise Tensor Operation (A * B)” includes element-wise add/minus/multiply/divide, also Kronecker, outer and Katri-Rao products. If the software contains one of them, we mark “YES”.
> 2) “TTM” means tensor-times-matrix multiplication. We distinguish TTM from tensor contraction. If the software includes tensor contraction, it can also support TTM.
> 3) For “MTTKRP”, we know most software can realize it through the above two operations. We mark it “YES”, only if an specified optimization for the whole operation.

NumPy has support for working with multidimensional tensors, if you like, but it doesn't really use the tensor language and notation (preferring instead to think in terms of "arrays" as a somewhat more computationally focused and less mathematically focused conceptual framework).

Which is to say that I actually have no idea what all those jargon terms you're asking about mean :-) I am suspicious that NumPy supports more of those operations than you have marked, just under different names/notation, but really can't tell either way for sure without knowing what exactly they are.

(It is definitely correct though that NumPy includes no support for sparse tensors, and NumPy itself is not multi-threaded beyond what we get for free through the BLAS, though there are external libraries that can perform multi-threaded computations on top of data stored in numpy arrays.)

-n