| 399 | static override className = 'Sequential'; |
| 400 | private model: LayersModel; |
| 401 | constructor(args?: SequentialArgs) { |
| 402 | super({inputs: [], outputs: []}); |
| 403 | args = args || {}; |
| 404 | |
| 405 | this.trainable = true; |
| 406 | this.built = false; |
| 407 | |
| 408 | // Set model name. |
| 409 | this.name = (args.name != null) ? args.name : getUid('sequential_'); |
| 410 | |
| 411 | // Add to the model any layers passed to the constructor. |
| 412 | if (args.layers != null) { |
| 413 | for (const layer of args.layers) { |
| 414 | this.add(layer); |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | // Helper function to Sequential.add Throws if the new output shape will be |
| 420 | // invalid. |