Flattens the input. Does not affect the batch size.
A Flatten layer flattens each batch in its inputs to 1D (making the output
2D).
For example:
constinput = tf.input({shape: [4, 3]}); constflattenLayer = tf.layers.flatten(); // Inspect the inferred output shape of the flatten layer, which // equals `[null, 12]`. The 2nd dimension is 4 * 3, i.e., the result of the // flattening. (The 1st dimension is the undermined batch size.) console.log(JSON.stringify(flattenLayer.apply(input).shape));
Flattens the input. Does not affect the batch size.
A
Flatten
layer flattens each batch in its inputs to 1D (making the output 2D).For example: