예제 #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
예제 #2
0
파일: ttensor.py 프로젝트: gbrouwer/Tensor
 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;
예제 #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])
예제 #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]);