# importing the library
import tensorflow as tf
# initializing the input
a = tf.constant([1,2,3,4,5,1,7,3,1,1,5], dtype = tf.int32)
weight = tf.constant([0,2,1,0,2,1,3,3,1,0,5], dtype = tf.int32)
# printing the input
print('a: ',a)
print('weight: ',weight)
# evaluating bin
r = tf.math.bincount(arr = a,weights = weight)
# printing result
print("Result: ",r)