@@ -131,14 +131,9 @@ def handle_alloc(
131131 strides = get_strides (arg )
132132 order = "'C'" if (arg .shape == () or strides [- 1 ] == 1 ) else "'F'"
133133
134- gen ("%(name)s = _lpy_np.empty(%(shape)s, "
135- "%(dtype)s, order=%(order)s)"
136- % dict (
137- name = arg .name ,
138- shape = strify (sym_shape ),
139- dtype = self .python_dtype_str (
140- gen , arg .dtype .numpy_dtype ),
141- order = order ))
134+ gen (f"{ arg .name } = _lpy_np.empty({ strify (sym_shape )} , "
135+ f"{ self .python_dtype_str (gen , arg .dtype .numpy_dtype )} , "
136+ f"order={ order } )" )
142137
143138 expected_strides = tuple (
144139 var ("_lpy_expected_strides_%s" % i )
@@ -152,12 +147,9 @@ def handle_alloc(
152147 [strify (s ) for s in sym_shape ],
153148 [strify (s ) for s in sym_strides ],
154149 [strify (s ) for s in expected_strides ])
155- gen ("assert %(strides_check)s, "
156- "'Strides of loopy created array %(name)s, "
157- "do not match expected.'" %
158- dict (strides_check = strides_check_expr ,
159- name = arg .name ,
160- strides = strify (sym_strides )))
150+ gen (f"assert { strides_check_expr } , "
151+ f"'Strides of loopy created array { arg .name } , "
152+ "do not match expected.'" )
161153 for i in range (num_axes ):
162154 gen ("del _lpy_shape_%d" % i )
163155 gen ("del _lpy_strides_%d" % i )
0 commit comments