@@ -49,8 +49,7 @@ def __init__(self,
49
49
underline_color = '#C2C2C2' , ignored_color = '#B4B4B4' , error_op_color = '#A40227' ,
50
50
show :(None ,'viz' )= 'viz' ,
51
51
hush_errors = True ,
52
- dtype_colors = None , dtype_precisions = None ,
53
- dtype_alpha_range = None , legend = False ):
52
+ dtype_colors = None , dtype_precisions = None , dtype_alpha_range = None ):
54
53
"""
55
54
Augment tensor-related exceptions generated from numpy, pytorch, and tensorflow.
56
55
Also display a visual representation of the offending Python line that
@@ -118,17 +117,16 @@ def __init__(self,
118
117
smaller the bit size, the lower the alpha channel. You
119
118
can play with the range to get better visual dynamic range
120
119
depending on how many precisions you want to display.
121
- :param legend: boolean: should a legend for the types encountered be presented?
122
120
"""
123
121
self .show , self .fontname , self .fontsize , self .dimfontname , self .dimfontsize , \
124
122
self .matrixcolor , self .vectorcolor , self .char_sep_scale ,\
125
123
self .fontcolor , self .underline_color , self .ignored_color , \
126
124
self .error_op_color , self .hush_errors , \
127
- self .dtype_colors , self .dtype_precisions , self .dtype_alpha_range , self . legend = \
125
+ self .dtype_colors , self .dtype_precisions , self .dtype_alpha_range = \
128
126
show , fontname , fontsize , dimfontname , dimfontsize , \
129
127
matrixcolor , vectorcolor , char_sep_scale , \
130
128
fontcolor , underline_color , ignored_color , error_op_color , hush_errors , \
131
- dtype_colors , dtype_precisions , dtype_alpha_range , legend
129
+ dtype_colors , dtype_precisions , dtype_alpha_range
132
130
133
131
def __enter__ (self ):
134
132
self .frame = sys ._getframe ().f_back # where do we start tracking? Hmm...not sure we use this
@@ -159,7 +157,8 @@ def __exit__(self, exc_type, exc_value, exc_traceback):
159
157
self .error_op_color ,
160
158
hush_errors = self .hush_errors ,
161
159
dtype_colors = self .dtype_colors ,
162
- legend = self .legend )
160
+ dtype_precisions = self .dtype_precisions ,
161
+ dtype_alpha_range = self .dtype_alpha_range )
163
162
if self .view is not None : # Ignore if we can't process code causing exception (I use a subparser)
164
163
if self .show == 'viz' :
165
164
self .view .show ()
@@ -173,8 +172,7 @@ def __init__(self,
173
172
vectorcolor = "#fefecd" , char_sep_scale = 1.8 , fontcolor = '#444443' ,
174
173
underline_color = '#C2C2C2' , ignored_color = '#B4B4B4' , error_op_color = '#A40227' ,
175
174
savefig = None , hush_errors = True ,
176
- dtype_colors = None , dtype_precisions = None ,
177
- dtype_alpha_range = None , legend = False ):
175
+ dtype_colors = None , dtype_precisions = None , dtype_alpha_range = None ):
178
176
"""
179
177
As the Python virtual machine executes lines of code, generate a
180
178
visualization for tensor-related expressions using from numpy, pytorch,
@@ -250,17 +248,16 @@ def __init__(self,
250
248
smaller the bit size, the lower the alpha channel. You
251
249
can play with the range to get better visual dynamic range
252
250
depending on how many precisions you want to display.
253
- :param legend: boolean: should a legend for the types encountered be presented?
254
251
"""
255
252
self .savefig , self .fontname , self .fontsize , self .dimfontname , self .dimfontsize , \
256
253
self .matrixcolor , self .vectorcolor , self .char_sep_scale ,\
257
254
self .fontcolor , self .underline_color , self .ignored_color , \
258
255
self .error_op_color , self .hush_errors , \
259
- self .dtype_colors , self .dtype_precisions , self .dtype_alpha_range , self . legend = \
256
+ self .dtype_colors , self .dtype_precisions , self .dtype_alpha_range = \
260
257
savefig , fontname , fontsize , dimfontname , dimfontsize , \
261
258
matrixcolor , vectorcolor , char_sep_scale , \
262
259
fontcolor , underline_color , ignored_color , error_op_color , hush_errors , \
263
- dtype_colors , dtype_precisions , dtype_alpha_range , legend
260
+ dtype_colors , dtype_precisions , dtype_alpha_range
264
261
265
262
def __enter__ (self ):
266
263
# print("ON trace", sys._getframe())
@@ -365,8 +362,7 @@ def viz_statement(self, code, frame):
365
362
hush_errors = self .explainer .hush_errors ,
366
363
dtype_colors = self .explainer .dtype_colors ,
367
364
dtype_precisions = self .explainer .dtype_precisions ,
368
- dtype_alpha_range = self .explainer .dtype_alpha_range ,
369
- legend = self .explainer .legend )
365
+ dtype_alpha_range = self .explainer .dtype_alpha_range )
370
366
self .views .append (view )
371
367
if self .explainer .savefig is not None :
372
368
file_path = Path (self .explainer .savefig )
0 commit comments