@@ -136,9 +136,9 @@ def __init__(
136
136
assert False , "Empty tensor cannot contain any elements"
137
137
138
138
elif prod (shape ) != data .size :
139
- assert (
140
- False
141
- ), "TTB:WrongSize, Size of data does not match specified size of tensor"
139
+ assert False , (
140
+ "TTB:WrongSize, Size of data does not match specified size of tensor"
141
+ )
142
142
143
143
# Make sure the data is indeed the right shape
144
144
if data .size > 0 and len (shape ) > 0 :
@@ -1607,9 +1607,9 @@ def ttt(
1607
1607
othershape = tuple (np .array (other .shape )[otherdims ])
1608
1608
1609
1609
if np .any (selfshape != othershape ):
1610
- assert (
1611
- False
1612
- ), f"Specified dimensions do not match got { selfshape } and { othershape } "
1610
+ assert False , (
1611
+ f"Specified dimensions do not match got { selfshape } and { othershape } "
1612
+ )
1613
1613
1614
1614
# Compute the product
1615
1615
@@ -1846,9 +1846,9 @@ def tenfun(
1846
1846
ttb .sumtensor ,
1847
1847
),
1848
1848
):
1849
- assert (
1850
- False
1851
- ), f"Invalid input to ten fun: { an_input } of type { type ( an_input ) } "
1849
+ assert False , (
1850
+ f"Invalid input to ten fun: { an_input } of type { type ( an_input ) } "
1851
+ )
1852
1852
input_tensors .append (self ._tt_to_tensor (an_input ))
1853
1853
1854
1854
# Case II: Expects input to be matrix and applies operation on each columns
@@ -1927,9 +1927,9 @@ def tenfun_unary(
1927
1927
if isinstance (an_input , (float , int )):
1928
1928
assert False , f"Argument { i } is a scalar but expected a tensor"
1929
1929
elif sz != an_input .shape :
1930
- assert (
1931
- False
1932
- ), f"Tensor { i } is not the same size as the first tensor input"
1930
+ assert False , (
1931
+ f"Tensor { i } is not the same size as the first tensor input"
1932
+ )
1933
1933
if len (inputs ) == 0 :
1934
1934
X = self .data
1935
1935
X = np .reshape (X , (1 , - 1 ), order = self .order )
@@ -2013,9 +2013,9 @@ def __setitem__(self, key, value):
2013
2013
def _set_linear (self , key , value ):
2014
2014
idx = key
2015
2015
if not isinstance (idx , slice ) and (idx > np .prod (self .shape )).any ():
2016
- assert (
2017
- False
2018
- ), "TTB:BadIndex In assignment X[I] = Y, a tensor X cannot be resized"
2016
+ assert False , (
2017
+ "TTB:BadIndex In assignment X[I] = Y, a tensor X cannot be resized"
2018
+ )
2019
2019
if isinstance (key , (int , float , np .generic )):
2020
2020
idx = np .array ([key ])
2021
2021
elif isinstance (key , slice ):
0 commit comments