| 970 | return normalizedInputs; |
| 971 | } |
| 972 | function addEdgeToGraph( |
| 973 | graph: SlimGraph, |
| 974 | inputName: string, |
| 975 | outputNode: OpNode, |
| 976 | input: NormalizedInput, |
| 977 | params: BuildParams, |
| 978 | index: number |
| 979 | ) { |
| 980 | // Don't allow loops in the graph. |
| 981 | if (inputName === outputNode.name) { |
| 982 | return; |
| 983 | } |
| 984 | // Check if this op type and input number corresponds to a |
| 985 | // reference edge using the refEdges dictionary in the params. |
| 986 | let isRefEdge = params.refEdges[outputNode.op + ' ' + index] === true; |
| 987 | graph.edges.push({ |
| 988 | v: inputName, |
| 989 | w: outputNode.name, |
| 990 | outputTensorKey: input.outputTensorKey, |
| 991 | isControlDependency: input.isControlDependency, |
| 992 | isReferenceEdge: isRefEdge, |
| 993 | }); |
| 994 | } |
| 995 | export const DefaultBuildParams: BuildParams = { |
| 996 | enableEmbedding: true, |
| 997 | inEmbeddingTypes: ['Const'], |