MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / create_undefined_variable

Function create_undefined_variable

python/paddle/jit/dy2static/utils.py:264–275  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

262
263
264def create_undefined_variable():
265 var = data_layer_not_check(
266 unique_name.generate("undefined_var"), [1], "float64"
267 )
268 var.stop_gradient = False
269 # the variable is created in block(0), we append assign in block(0) either.
270 helper = LayerHelper('create_undefined_variable', **locals())
271 saved_block_ids = helper.main_program.current_block_idx
272 helper.main_program.current_block_idx = 0
273 paddle.assign(RETURN_NO_VALUE_MAGIC_NUM, var)
274 helper.main_program.current_block_idx = saved_block_ids
275 return var
276
277
278class UndefinedVar:

Callers 2

create_var_likeFunction · 0.90
to_static_variableFunction · 0.85

Calls 4

LayerHelperClass · 0.90
data_layer_not_checkFunction · 0.85
generateMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected