Skip to content

Commit 25c915d

Browse files
authored
FactorizedTensor: use class name as default name
1 parent e602edf commit 25c915d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tltorch/factorized_tensors/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,10 @@ def __init_subclass__(cls, name, **kwargs):
155155
cls._name = name
156156
else:
157157
if cls.__name__ != "TensorizedTensor": # Don't display warning when instantiating the TensorizedTensor class
158-
warnings.warn(f'Creating a subclass of FactorizedTensor {cls.__name__} with no name.')
158+
name = cls.__name__
159+
warnings.warn(f'Creating a subclass of FactorizedTensor {cls.__name__} with no name, using class name {name}.')
160+
super().__init_subclass__(name=name, **kwargs)
161+
159162

160163
def __new__(cls, *args, **kwargs):
161164
"""Customize the creation of a factorized convolution

0 commit comments

Comments
 (0)