<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
I'm using tensorflow 2.10.0.
<ASSISTANT_TASK:>
Python Code:
import tensorflow as tf
labels = [0, 6, 5, 4, 2]
def g(labels):
    t = tf.one_hot(indices=labels, depth=10, on_value=0, off_value=1, axis=-1)
    n = t.numpy()
    for i in range(len(n)):
        n[i] = n[i][::-1]
    return tf.constant(n)
result = g(labels.copy())
<END_TASK>