@@ -4333,17 +4333,17 @@ def __str__(self):
4333
4333
4334
4334
# Rename internal variables
4335
4335
for i , r in enumerate (self .fgraph .inputs ):
4336
- r .name = f"i{ int ( i ) } "
4336
+ r .name = f"i{ i } "
4337
4337
for i , r in enumerate (self .fgraph .outputs ):
4338
- r .name = f"o{ int ( i ) } "
4338
+ r .name = f"o{ i } "
4339
4339
io = set (self .fgraph .inputs + self .fgraph .outputs )
4340
4340
for i , r in enumerate (self .fgraph .variables ):
4341
4341
if (
4342
4342
not isinstance (r , Constant )
4343
4343
and r not in io
4344
4344
and len (self .fgraph .clients [r ]) > 1
4345
4345
):
4346
- r .name = f"t{ int ( i ) } "
4346
+ r .name = f"t{ i } "
4347
4347
4348
4348
if len (self .fgraph .outputs ) > 1 or len (self .fgraph .apply_nodes ) > 10 :
4349
4349
self ._name = "Composite{...}"
@@ -4431,7 +4431,7 @@ def c_code_template(self):
4431
4431
return self ._c_code
4432
4432
4433
4433
fg = self .fgraph
4434
- subd = {e : f"%(i{ int ( i ) } )s" for i , e in enumerate (fg .inputs )}
4434
+ subd = {e : f"%(i{ i } )s" for i , e in enumerate (fg .inputs )}
4435
4435
4436
4436
for var in fg .variables :
4437
4437
if var .owner is None :
@@ -4458,26 +4458,26 @@ def c_code_template(self):
4458
4458
for output in node .outputs :
4459
4459
if output not in subd :
4460
4460
i += 1
4461
- name = f"V%(id)s_tmp{ int ( i ) } "
4461
+ name = f"V%(id)s_tmp{ i } "
4462
4462
subd [output ] = name
4463
4463
_c_code += f"{ output .type .dtype_specs ()[1 ]} { name } ;\n "
4464
4464
4465
- nodename = f"%(nodename)s_subnode{ int ( j ) } "
4465
+ nodename = f"%(nodename)s_subnode{ j } "
4466
4466
nodenames .append (nodename )
4467
4467
4468
4468
s = node .op .c_code (
4469
4469
node ,
4470
4470
nodename ,
4471
4471
[subd [input ] for input in node .inputs ],
4472
4472
[subd [output ] for output in node .outputs ],
4473
- dict (fail = "%(fail)s" , id = f"%(id)s_{ int ( j ) } " ),
4473
+ dict (fail = "%(fail)s" , id = f"%(id)s_{ j } " ),
4474
4474
)
4475
4475
_c_code += s
4476
4476
_c_code += "\n "
4477
4477
4478
4478
# Copy the temporary outputs to the real outputs
4479
4479
for i , output in enumerate (fg .outputs ):
4480
- _c_code += f"%(o{ int ( i ) } )s = { subd [output ]} ;\n "
4480
+ _c_code += f"%(o{ i } )s = { subd [output ]} ;\n "
4481
4481
4482
4482
_c_code += "}\n "
4483
4483
@@ -4488,8 +4488,8 @@ def c_code_template(self):
4488
4488
def c_code (self , node , nodename , inames , onames , sub ):
4489
4489
d = dict (
4490
4490
chain (
4491
- zip ((f"i{ int ( i ) } " for i in range (len (inames ))), inames , strict = True ),
4492
- zip ((f"o{ int ( i ) } " for i in range (len (onames ))), onames , strict = True ),
4491
+ zip ((f"i{ i } " for i in range (len (inames ))), inames , strict = True ),
4492
+ zip ((f"o{ i } " for i in range (len (onames ))), onames , strict = True ),
4493
4493
),
4494
4494
** sub ,
4495
4495
)
0 commit comments