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