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

Function _create_array_out_of_while

python/paddle/nn/decode.py:888–895  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

886 return paddle.transpose(x, [1, 0, *list(range(2, len(x.shape)))])
887
888 def _create_array_out_of_while(dtype):
889 current_block_idx = default_main_program().current_block_idx
890 default_main_program().current_block_idx = (
891 default_main_program().current_block().parent_idx
892 )
893 tensor_array = paddle.tensor.array.create_array(dtype)
894 default_main_program().current_block_idx = current_block_idx
895 return tensor_array
896
897 # While
898 with while_op.block():

Callers 2

Calls 5

default_main_programFunction · 0.90
current_blockMethod · 0.80
set_insertion_pointMethod · 0.80
global_blockMethod · 0.80
backMethod · 0.45

Tested by

no test coverage detected