node_modules/@tensorflow/tfjs-layers/dist/engine/input_layer.js
/**
 * Used to instantiate an input to a model as a `tf.SymbolicTensor`.
 *
 * Users should call the `input` factory function for
 * consistency with other generator functions.
 *
 * Example:
 *
 * ```js
 * // Defines a simple logistic regression model with 32 dimensional input
 * // and 3 dimensional output.
 * const x = tf.input({shape: [32]});
 * const y = tf.layers.dense({units: 3, activation: 'softmax'}).apply(x);
 * const model = tf.LayersModel({inputs: x, outputs: y});
 * model.predict(tf.ones([2, 32])).print();
 * ```
 *
 * Note: `input` is only necessary when using `model`. When using
 * `sequential`, specify `inputShape` for the first layer or use `inputLayer`
 * as the first layer.
 */
Used to instantiate an input to a model as a `tf.SymbolicTensor`.
Users should call the `input` factory function for
consistency with other generator functions.



```js
Defines a simple logistic regression model with 32 dimensional input
and 3 dimensional output.

`input` is only necessary when using `model`.
Used to instantiate an input to a model as a ` tf . SymbolicTensor ` . Users should call the ` input ` factory function for consistency with other generator functions . ` ` ` js Defines a simple logistic regression model with 32 dimensional input and 3 dimensional output . ` input ` is only necessary when using ` model ` .
function Input(config) {
    if (config.batchShape == null && config.shape == null) {
        throw new Error('Please provide to Input either a `shape`' +
            ' or a `batchShape` argument. Note that ' +
            '`shape` does not include the batch ' +
            'dimension.');
    }
    if (config.batchShape != null && config.shape != null) {
        throw new errors_1.ValueError('Please provide either a `shape` or `batchShape` ' +
            'argument to Input, but not both.');
    }
    var batchShape = config.batchShape;
    if (config.shape != null && batchShape == null) {
        batchShape = [null].concat(config.shape);
    }
    var dtype = config.dtype;
    if (dtype == null) {
        dtype = 'float32';
    }
    var inputLayer = new InputLayer({
        batchInputShape: batchShape,
        name: config.name,
        dtype: dtype,
        sparse: config.sparse
    });
    var outputs = inputLayer.inboundNodes[0].outputTensors;
    return outputs[0];
}
function Input ( config ) { if ( config . batchShape == null && config . shape == null ) { throw new Error ( 'Please provide to Input either a `shape`' + ' or a `batchShape` argument. Note that ' + '`shape` does not include the batch ' + 'dimension.' ) ; } if ( config . batchShape != null && config . shape != null ) { throw new errors_1 . ValueError ( 'Please provide either a `shape` or `batchShape` ' + 'argument to Input, but not both.' ) ; } var batchShape = config . batchShape ; if ( config . shape != null && batchShape == null ) { batchShape = [ null ] . concat ( config . shape ) ; } var dtype = config . dtype ; if ( dtype == null ) { dtype = 'float32' ; } var inputLayer = new InputLayer ( { batchInputShape : batchShape , name : config . name , dtype : dtype , sparse : config . sparse } ) ; var outputs = inputLayer . inboundNodes [ 0 ] . outputTensors ; return outputs [ 0 ] ; }
Used to instantiate an input to a model as a `tf.SymbolicTensor`.
Used to instantiate an input to a model as a ` tf . SymbolicTensor ` .
// TODO(michaelterry): Backport to PyKeras.