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

Function createSimpleTwoLayerContainer

tfjs-layers/src/engine/container_test.ts:366–377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364 });
365
366 function createSimpleTwoLayerContainer(): [Container, Layer[]] {
367 const inputShape = [2, 2];
368 const inputLayer = tfl.layers.input({shape: inputShape});
369 const layer1 = tfl.layers.reshape({targetShape: [4], name: 'reshapeLayer'});
370 const layer1Output = layer1.apply(inputLayer) as tfl.SymbolicTensor;
371 const layer2 =
372 tfl.layers.dense({units: 2, useBias: false, name: 'denseLayer'});
373 const layer2Output = layer2.apply(layer1Output) as tfl.SymbolicTensor;
374 const container =
375 new ContainerForTest({inputs: [inputLayer], outputs: [layer2Output]});
376 return [container, [container.inputLayers[0], layer1, layer2]];
377 }
378
379 it('getLayer works by name', () => {
380 const [container, layers] = createSimpleTwoLayerContainer();

Callers 1

container_test.tsFile · 0.85

Calls 2

reshapeMethod · 0.80
applyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…