import * as tf from
"@tensorflow/tfjs"
;
const x = tf.tensor([1, 2, 9, 6, 5, 4,
7, 4, 7, 4, 3], [1, 11],
'int32'
);
const weight = [0, 2, 5, 8, 9, 3, 5, 5, 3, 8, 2];
const size = 10;
const out = tf.denseBincount(x, weight, size);
console.log(out.print());