Hello,
I think it is just because Tensor object has no attribute message.
How about create a dict at the very first and change this line:
x.message --> dict['x'] = 'message'

Is there any better solutions? Let me know, thank you.