MCPcopy Create free account
hub / github.com/tensorflow/tfjs / compareFunction

Function compareFunction

tfjs-layers/src/engine/container_test.ts:217–225  ·  view source on GitHub ↗
(a: Layer, b: Layer)

Source from the content-addressed store, hash-verified

215 {inputs: [inputTensor], outputs: [output1, output2]});
216
217 const compareFunction = (a: Layer, b: Layer) => {
218 if (a.name < b.name) {
219 return -1;
220 } else if (a.name > b.name) {
221 return 1;
222 } else {
223 return 0;
224 }
225 };
226 const sortedLayers = container.layers.slice().sort(compareFunction);
227 const expectedSortedLayers = [
228 inputTensor.sourceLayer, layerA, layerB, layerC, layerX

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…