4
4
import numpy as np
5
5
import copy
6
6
7
- __all__ = ['Block' , 'Variable' , 'Program' , 'Operator' , 'default_startup_program' , 'default_main_program' ]
7
+ __all__ = [
8
+ 'Block' , 'Variable' , 'Program' , 'Operator' , 'default_startup_program' ,
9
+ 'default_main_program'
10
+ ]
8
11
9
12
10
13
def unique_name (prefix ):
@@ -232,17 +235,17 @@ def find_name(var_list, name):
232
235
in_proto .name )
233
236
234
237
if found :
235
- in_argus = inputs [in_proto .name ]
236
- if not isinstance (in_argus , list ):
237
- in_argus = [in_argus ]
238
- if not in_proto .duplicable and len (in_argus ) > 1 :
238
+ in_args = inputs [in_proto .name ]
239
+ if not isinstance (in_args , list ):
240
+ in_args = [in_args ]
241
+ if not in_proto .duplicable and len (in_args ) > 1 :
239
242
raise ValueError (
240
243
"Input %s expects only one input, but %d are given."
241
- % (in_proto .name , len (in_argus )))
242
- in_argu_names = []
243
- for argu in in_argus :
244
- in_argu_names .append (argu .name )
245
- self .desc .set_input (in_proto .name , in_argu_names )
244
+ % (in_proto .name , len (in_args )))
245
+ in_arg_names = []
246
+ for arg in in_args :
247
+ in_arg_names .append (arg .name )
248
+ self .desc .set_input (in_proto .name , in_arg_names )
246
249
else :
247
250
self .desc .set_input (in_proto .name , [])
248
251
@@ -260,18 +263,18 @@ def find_name(var_list, name):
260
263
str (e ) for e in given )))
261
264
262
265
for out_proto in proto .outputs :
263
- out_argus = outputs [out_proto .name ]
264
- if not isinstance (out_argus , list ):
265
- out_argus = [out_argus ]
266
- if not out_proto .duplicable and len (out_argus ) > 1 :
266
+ out_args = outputs [out_proto .name ]
267
+ if not isinstance (out_args , list ):
268
+ out_args = [out_args ]
269
+ if not out_proto .duplicable and len (out_args ) > 1 :
267
270
raise ValueError (
268
271
"Output %s expects only one output, but %d are given." %
269
- (out_proto .name , len (out_argus )))
270
- out_argu_names = []
271
- for argu in out_argus :
272
- out_argu_names .append (argu .name )
273
- argu .op = self
274
- self .desc .set_output (out_proto .name , out_argu_names )
272
+ (out_proto .name , len (out_args )))
273
+ out_arg_names = []
274
+ for arg in out_args :
275
+ out_arg_names .append (arg .name )
276
+ arg .op = self
277
+ self .desc .set_output (out_proto .name , out_arg_names )
275
278
276
279
if attrs is not None :
277
280
if not isinstance (attrs , dict ):
@@ -582,8 +585,10 @@ def __init__(self, block, shape, dtype, **kwargs):
582
585
g_main_program = Program ()
583
586
g_startup_program = Program ()
584
587
588
+
585
589
def default_startup_program ():
586
590
return g_startup_program
587
591
592
+
588
593
def default_main_program ():
589
594
return g_main_program
0 commit comments