def __str__(self):
A string describing the TensorTrain object, its TT-rank and shape.
// TODO: tensors vs variables.
shape = self.get_shape()
tt_ranks = self.get_tt_ranks()
if self.is_tt_matrix():
raw_shape = self.get_raw_shape()
return "A Tensor Train Matrix of size %d x %d, underlying tensor " \
"shape: %s x %s, TT-ranks: %s" % (shape[0], shape[1],
raw_shape[0], raw_shape[1],
tt_ranks)
else:
return "A Tensor Train of shape %s, TT-ranks: %s" % (shape, tt_ranks)
def ndims(self):
Get the number of dimensions of the underlying TT-tensor.
Returns: