TensorFlow.js version
@tensorflow/tfjs-layers@0.6.2
file: https://github.com/tensorflow/tfjs-layers/blob/master/src/models.ts#L478
Browser version
N/A (node.js)
Describe the problem or feature request
Typescript type check error.
https://github.com/tensorflow/tfjs-layers/blob/master/src/models.ts#L478
Sequential.build(inputShape?: Shape): void incompatible with parent definition Layer.build(inputShape: Shape | Shape[]): void;
Should be
Sequential.build(inputShape?: Shape | Shape[]): void
Code to reproduce the bug / link to feature request
import '@tensorflow/tfjs-node';
import * as tf from '@tensorflow/tfjs';
tf.setBackend('tensorflow');
Then run tsc (assuming tsconfig.json in the project, with strict = true)
and you get
node_modules/@tensorflow/tfjs-layers/dist/models.d.ts(28,5): error TS2416: Property 'build' in type 'Sequential' is not assignable to the same property in base type 'Model'.
Type '(inputShape?: number[] | undefined) => void' is not assignable to type '(inputShape: number[] | number[][]) => void'.
Types of parameters 'inputShape' and 'inputShape' are incompatible.
Type 'number[] | number[][]' is not assignable to type 'number[] | undefined'.
Type 'number[][]' is not assignable to type 'number[] | undefined'.
Type 'number[][]' is not assignable to type 'number[]'.
Type 'number[]' is not assignable to type 'number'.
From vscode:
The easiest way to see this error for end-user is to open the node_modules/@tensorflow/tfjs-layers/dist/models.d.ts in vscode

TensorFlow.js version
@tensorflow/tfjs-layers@0.6.2
file: https://github.com/tensorflow/tfjs-layers/blob/master/src/models.ts#L478
Browser version
N/A (node.js)
Describe the problem or feature request
Typescript type check error.
https://github.com/tensorflow/tfjs-layers/blob/master/src/models.ts#L478
Sequential.build(inputShape?: Shape): voidincompatible with parent definitionLayer.build(inputShape: Shape | Shape[]): void;Should be
Sequential.build(inputShape?: Shape | Shape[]): voidCode to reproduce the bug / link to feature request
Then run
tsc(assumingtsconfig.jsonin the project, with strict = true)and you get
From vscode:
The easiest way to see this error for end-user is to open the

node_modules/@tensorflow/tfjs-layers/dist/models.d.tsin vscode