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

Function getLayerSummary

tfjs-vis/src/show/model.ts:151–166  ·  view source on GitHub ↗
(layer: Layer)

Source from the content-addressed store, hash-verified

149 * Gets summary information/metadata about a layer.
150 */
151function getLayerSummary(layer: Layer): LayerSummary {
152 let outputShape: string;
153 if (Array.isArray(layer.outputShape[0])) {
154 const shapes = (layer.outputShape as number[][]).map(s => formatShape(s));
155 outputShape = `[${shapes.join(', ')}]`;
156 } else {
157 outputShape = formatShape(layer.outputShape as number[]);
158 }
159
160 return {
161 name: layer.name,
162 trainable: layer.trainable,
163 parameters: layer.countParams(),
164 outputShape,
165 };
166}
167
168interface LayerSummary {
169 name: string;

Callers

nothing calls this directly

Calls 3

formatShapeFunction · 0.85
joinMethod · 0.80
countParamsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…