Patent ID: 11960866
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 18:
19. A processing system comprising:
a memory storing instructions; and
at least one processor in communication with the memory, the at least one processor configured, upon execution of the instructions, to perform the following steps:
receiving a TensorFlow graph including one or more control flows;
processing the TensorFlow graph to extract control flows from the TensorFlow graph and storing the control flows in an extracted control flows data structure;
applying a recursive trace algorithm on outputs of the TensorFlow graph, the applying the recursive trace algorithm comprising: recursively utilizing the extracted control flows data structure, on the outputs of the TensorFlow graph, to construct a common intermediate representation that expresses hierarchical control flows;
removing all forwarding nodes contained within a TensorFlow graph loop predicate and loop bodies;
for each respective nested common intermediate representation branch within the TensorFlow graph loop predicate and the loop bodies, responsive to determining that the respective nested common intermediate representation branch has an empty branch predicate:
transferring all nodes within a common intermediate representation branch into TensorFlow graph loop or bodies containing a branch; and
removing the common intermediate representation branch from the TensorFlow graph loop predicate or the loop bodies;

storing a common intermediate representation loop corresponding to the TensorFlow graph loop in the extracted control flows data structure, wherein the common intermediate representation loop includes the TensorFlow graph loop predicate and the loop bodies; and
constructing one or more compiler intermediate representations from the common intermediate representation.