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
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;
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])
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]);