@@ -95,10 +95,10 @@ def cleanup():
95
95
def print_title (title , overline = "" , underline = "" ):
96
96
len_title = len (title )
97
97
if overline :
98
- print (str (overline ) * len_title )
99
- print (title )
98
+ print (str (overline ) * len_title ) # noqa: T201
99
+ print (title ) # noqa: T201
100
100
if underline :
101
- print (str (underline ) * len_title )
101
+ print (str (underline ) * len_title ) # noqa: T201
102
102
103
103
104
104
def print_compiledir_content ():
@@ -159,7 +159,7 @@ def print_compiledir_content():
159
159
_logger .error (f"Could not read key file '{ filename } '." )
160
160
161
161
print_title (f"PyTensor cache: { compiledir } " , overline = "=" , underline = "=" )
162
- print ()
162
+ print () # noqa: T201
163
163
164
164
print_title (f"List of { len (table )} compiled individual ops" , underline = "+" )
165
165
print_title (
@@ -168,9 +168,9 @@ def print_compiledir_content():
168
168
)
169
169
table = sorted (table , key = lambda t : str (t [1 ]))
170
170
for dir , op , types , compile_time in table :
171
- print (dir , f"{ compile_time :.3f} s" , op , types )
171
+ print (dir , f"{ compile_time :.3f} s" , op , types ) # noqa: T201
172
172
173
- print ()
173
+ print () # noqa: T201
174
174
print_title (
175
175
f"List of { len (table_multiple_ops )} compiled sets of ops" , underline = "+"
176
176
)
@@ -180,9 +180,9 @@ def print_compiledir_content():
180
180
)
181
181
table_multiple_ops = sorted (table_multiple_ops , key = lambda t : (t [1 ], t [2 ]))
182
182
for dir , ops_to_str , types_to_str , compile_time in table_multiple_ops :
183
- print (dir , f"{ compile_time :.3f} s" , ops_to_str , types_to_str )
183
+ print (dir , f"{ compile_time :.3f} s" , ops_to_str , types_to_str ) # noqa: T201
184
184
185
- print ()
185
+ print () # noqa: T201
186
186
print_title (
187
187
(
188
188
f"List of { len (table_op_class )} compiled Op classes and "
@@ -191,33 +191,33 @@ def print_compiledir_content():
191
191
underline = "+" ,
192
192
)
193
193
for op_class , nb in reversed (table_op_class .most_common ()):
194
- print (op_class , nb )
194
+ print (op_class , nb ) # noqa: T201
195
195
196
196
if big_key_files :
197
197
big_key_files = sorted (big_key_files , key = lambda t : str (t [1 ]))
198
198
big_total_size = sum (sz for _ , sz , _ in big_key_files )
199
- print (
199
+ print ( # noqa: T201
200
200
f"There are directories with key files bigger than { int (max_key_file_size )} bytes "
201
201
"(they probably contain big tensor constants)"
202
202
)
203
- print (
203
+ print ( # noqa: T201
204
204
f"They use { int (big_total_size )} bytes out of { int (total_key_sizes )} (total size "
205
205
"used by all key files)"
206
206
)
207
207
208
208
for dir , size , ops in big_key_files :
209
- print (dir , size , ops )
209
+ print (dir , size , ops ) # noqa: T201
210
210
211
211
nb_keys = sorted (nb_keys .items ())
212
- print ()
212
+ print () # noqa: T201
213
213
print_title ("Number of keys for a compiled module" , underline = "+" )
214
214
print_title (
215
215
"number of keys/number of modules with that number of keys" , underline = "-"
216
216
)
217
217
for n_k , n_m in nb_keys :
218
- print (n_k , n_m )
219
- print ()
220
- print (
218
+ print (n_k , n_m ) # noqa: T201
219
+ print () # noqa: T201
220
+ print ( # noqa: T201
221
221
f"Skipped { int (zeros_op )} files that contained 0 op "
222
222
"(are they always pytensor.scalar ops?)"
223
223
)
@@ -242,18 +242,18 @@ def basecompiledir_ls():
242
242
subdirs = sorted (subdirs )
243
243
others = sorted (others )
244
244
245
- print (f"Base compile dir is { config .base_compiledir } " )
246
- print ("Sub-directories (possible compile caches):" )
245
+ print (f"Base compile dir is { config .base_compiledir } " ) # noqa: T201
246
+ print ("Sub-directories (possible compile caches):" ) # noqa: T201
247
247
for d in subdirs :
248
- print (f" { d } " )
248
+ print (f" { d } " ) # noqa: T201
249
249
if not subdirs :
250
- print (" (None)" )
250
+ print (" (None)" ) # noqa: T201
251
251
252
252
if others :
253
- print ()
254
- print ("Other files in base_compiledir:" )
253
+ print () # noqa: T201
254
+ print ("Other files in base_compiledir:" ) # noqa: T201
255
255
for f in others :
256
- print (f" { f } " )
256
+ print (f" { f } " ) # noqa: T201
257
257
258
258
259
259
def basecompiledir_purge ():
0 commit comments