How does one individually extract elements from a tensor?
First recognize that your input array has shape (1,2), so a[0]*a[1] will not work.

Following is the code that is working for me-

def mul(a):
    return a[0][0]*a[0][1]

a = tf.constant([[2,3]])
b = tf.contrib.eager.py_func(func = mul, inp=[a], Tout = tf.int32)
with tf.Session() as sess:
    sess.run(b)


If you want to pass custom functions, check this link- https://www.tensorflow.org/api_docs/python/tf/py_function