Example #1
0
    def totensor(self):
        """returns a tensor object that is represented by the tucker tensor"""

        #ensure that there is enough space
        X = tensor.tenzeros(self.shape)
        X = self.core.ttm(self.u)

        if (X.__class__ == sptensor.sptensor):
            X = X.totensor()
        return X
Example #2
0
 def totensor(self):
     """returns a tensor object that is represented by the tucker tensor"""
     
     #ensure that there is enough space
     X = tensor.tenzeros(self.shape);
     X = self.core.ttm(self.u);
     
     if(X.__class__ == sptensor.sptensor):
         X = X.totensor();
     return X;
Example #3
0
def specialctor(verbose):
    print tensor.tenrands([2, 3, 4])
    print tensor.tenones([2, 3, 4])
    print tensor.tenzeros([2, 3, 4])
    print tensor.tendiag([11, 22, 33], [2, 3, 4])
    print tensor.tendiag([11, 22], [1, 3, 4])
Example #4
0
def specialctor(verbose):
    print tensor.tenrands([2,3,4]);
    print tensor.tenones([2,3,4]);
    print tensor.tenzeros([2,3,4]);
    print tensor.tendiag([11,22,33],[2,3,4]);
    print tensor.tendiag([11,22],[1,3,4]);