Skip to content

Commit

Permalink
Remove uncessary warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanKossaifi committed Oct 27, 2022
1 parent d0b5e71 commit c9f402c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tltorch/factorized_layers/factorized_convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def _ensure_array(layers_shape, order, value, one_per_order=True):
return value

if isinstance(value, int):
array = np.ones(target_shape, dtype=np.int)*value
array = np.ones(target_shape, dtype=np.int32)*value
else:
assert len(value) == order
array = np.ones(target_shape, dtype=np.int)
array = np.ones(target_shape, dtype=np.int32)
array[..., :] = value
return array

Expand Down
5 changes: 3 additions & 2 deletions tltorch/factorized_tensors/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def __init_subclass__(cls, name, **kwargs):
cls._factorizations[name.lower()] = cls
cls._name = name
else:
warnings.warn(f'Creating a subclass of FactorizedTensor {cls.__name__} with no name.')
if cls.__name__ != "TensorizedTensor": # Don't display warning when instantiating the TensorizedTensor class
warnings.warn(f'Creating a subclass of FactorizedTensor {cls.__name__} with no name.')

def __new__(cls, *args, **kwargs):
"""Customize the creation of a factorized convolution
Expand Down Expand Up @@ -515,7 +516,7 @@ def to_matrix(self):
If several matrices are parametrized, a batch of matrices is returned
"""
warnings.warn(f'{self} is being reconstructed into a matrix, consider operating on the decomposed form.')
# warnings.warn(f'{self} is being reconstructed into a matrix, consider operating on the decomposed form.')

return self.to_tensor().reshape(self.shape)

Expand Down
2 changes: 1 addition & 1 deletion tltorch/functional/factorized_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Author: Jean Kossaifi

def linear_tucker(tensor, tucker_matrix, transpose=True):
def linear_tucker(tensor, tucker_matrix, transpose=True, channels_first=True):
if transpose:
contraction_axis = 1
else:
Expand Down

0 comments on commit c9f402c

Please sign in to comment.