(layer: Layer)
| 149 | * Gets summary information/metadata about a layer. |
| 150 | */ |
| 151 | function 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 | |
| 168 | interface LayerSummary { |
| 169 | name: string; |
nothing calls this directly
no test coverage detected
searching dependent graphs…