* Returns predictions for a single batch of samples. * * ```js * const model = tf.sequential({ * layers: [tf.layers.dense({units: 1, inputShape: [10]})] * }); * model.predictOnBatch(tf.ones([8, 10])).print(); * ``` * @param x: Input samples, as a Tensor (for models with exa
(x: Tensor|Tensor[])
| 1135 | * @doc {heading: 'Models', subheading: 'Classes'} |
| 1136 | */ |
| 1137 | predictOnBatch(x: Tensor|Tensor[]): Tensor|Tensor[] { |
| 1138 | checkInputData(x, this.inputNames, this.feedInputShapes, true); |
| 1139 | // TODO(cais): Take care of the learning_phase boolean flag. |
| 1140 | // if (this.useLearningPhase) ... |
| 1141 | const batchSize = (Array.isArray(x) ? x[0] : x).shape[0]; |
| 1142 | return this.predictLoop(x, batchSize); |
| 1143 | } |
| 1144 | |
| 1145 | protected standardizeUserDataXY( |
| 1146 | x: Tensor|Tensor[]|{[inputName: string]: Tensor}, |
nothing calls this directly
no test coverage detected