@@ -427,12 +427,12 @@ def __getitem__(self, indices):
427
427
# Select one dimension of one mode
428
428
factor , next_factor , * factors = self .factors
429
429
next_factor = tenalg .mode_dot (next_factor , factor [:, indices , :].squeeze (1 ), 0 )
430
- return TTTensor ([next_factor , * factors ])
430
+ return self . __class__ ([next_factor , * factors ])
431
431
432
432
elif isinstance (indices , slice ):
433
433
mixing_factor , * factors = self .factors
434
434
factors = [mixing_factor [:, indices ], * factors ]
435
- return TTTensor (factors )
435
+ return self . __class__ (factors )
436
436
437
437
else :
438
438
factors = []
@@ -463,9 +463,9 @@ def __getitem__(self, indices):
463
463
else :
464
464
next_factor , * factors = self .factors [i + 1 :]
465
465
factor = tenalg .mode_dot (next_factor , factor , 0 )
466
- return TTTensor ([factor , * factors ])
466
+ return self . __class__ ([factor , * factors ])
467
467
else :
468
- return TTTensor ([* factors , factor , * self .factors [i + 1 :]])
468
+ return self . __class__ ([* factors , factor , * self .factors [i + 1 :]])
469
469
470
470
def transduct (self , new_dim , mode = 0 , new_factor = None ):
471
471
"""Transduction adds a new dimension to the existing factorization
0 commit comments