* Determine whether the container is stateful. * * Porting Note: this is the equivalent of the stateful @property of * the Container class in PyKeras.
()
| 1343 | * the Container class in PyKeras. |
| 1344 | */ |
| 1345 | override get stateful(): boolean { |
| 1346 | // Porting Note: This check is to prevent inadvertent setting of the |
| 1347 | // _stateful property of the Container instance. |
| 1348 | if (this._stateful) { |
| 1349 | throw new ValueError( |
| 1350 | 'Container instance unexpectedly has _stateful = true. The ' + |
| 1351 | 'statefulness of a Container is determined by the Layers it ' + |
| 1352 | 'contains. Its _stateful property must remain the default false.'); |
| 1353 | } |
| 1354 | for (const layer of this.layers) { |
| 1355 | if (layer.stateful) { |
| 1356 | return true; |
| 1357 | } |
| 1358 | } |
| 1359 | return false; |
| 1360 | } |
| 1361 | |
| 1362 | /** |
| 1363 | * Reset the state of all stateful constituent layers (if any). |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…