MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / while_body

Function while_body

tensorflow/python/ops/parallel_for/pfor.py:950–965  ·  view source on GitHub ↗

Body of while loop.

(i, *ta_list)

Source from the content-addressed store, hash-verified

948 iters = pfor_input.pfor.loop_len_vector[0]
949
950 def while_body(i, *ta_list):
951 """Body of while loop."""
952 inputs = [
953 x[i, ...] if stacked else x for x, stacked, _ in pfor_input.inputs
954 ]
955 op_outputs = _create_op(
956 pfor_input.op_type,
957 inputs,
958 output_dtypes,
959 attrs=pfor_input.op.node_def.attr).outputs
960
961 outputs = []
962 for out, ta in zip(op_outputs, ta_list):
963 assert isinstance(out, ops.Tensor)
964 outputs.append(ta.write(i, array_ops.expand_dims(out, 0)))
965 return tuple([i + 1] + outputs)
966
967 ta_list = control_flow_ops.while_loop(
968 lambda i, *ta: i < iters, while_body, [0] + [

Callers 3

CloneWithNewOperandsMethod · 0.50
IdenticalSlowPathMethod · 0.50

Calls 5

_create_opFunction · 0.85
tupleFunction · 0.85
appendMethod · 0.45
writeMethod · 0.45
expand_dimsMethod · 0.45

Tested by

no test coverage detected