import * as tf from
"@tensorflow/tfjs"
;
const Input = tf.input({ shape: [3, 5] });
const globalmaxPoolingLayer =
tf.layers.globalMaxPooling1d({ dataFormat:
'channelLast'
});
const Output = globalmaxPoolingLayer.apply(Input);
const model = tf.model({ inputs: Input, outputs: Output });
const Data =
tf.tensor3d([2, 3, 5, 1, 3, 5, 8, 2, 2, 6, 8, 9, 4, 8, 9, 3,
8, 4, 2, 2, 9, 2, 4, 6, 4, 2, 6, 4, 2, 5 ],
[2, 3, 5]);
model.predict(Data).print();