MCPcopy
hub / github.com/tensorflow/tfjs / getNodeOutputs

Function getNodeOutputs

tfjs-layers/src/engine/executor.ts:522–541  ·  view source on GitHub ↗

* Get the symbolic output tensors of the node to which a given fetch belongs. * @param fetch The fetched symbolic tensor. * @returns The Array of symbolic tensors output by the node to which `fetch` * belongs.

(fetch: SymbolicTensor)

Source from the content-addressed store, hash-verified

520 * belongs.
521 */
522function getNodeOutputs(fetch: SymbolicTensor): SymbolicTensor|
523 SymbolicTensor[] {
524 let layerOutputs: SymbolicTensor|SymbolicTensor[];
525 if (fetch.sourceLayer.inboundNodes.length === 1) {
526 layerOutputs = fetch.sourceLayer.output;
527 } else {
528 let nodeIndex: number = null;
529 for (let i = 0; i < fetch.sourceLayer.inboundNodes.length; ++i) {
530 for (const outputTensor of fetch.sourceLayer.inboundNodes[i]
531 .outputTensors) {
532 if (outputTensor.id === fetch.id) {
533 nodeIndex = i;
534 break;
535 }
536 }
537 }
538 layerOutputs = fetch.sourceLayer.getOutputAt(nodeIndex);
539 }
540 return layerOutputs;
541}

Callers 1

executeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…