Hi @Alessandro_Castelli , welcome to the Forum!
I ran your code and I’m seeing an error arising from the fact that your data is a SymbolicTensor.
What demo where you using as example?
Because your code is complex it’s hard to find how to fully solve it.
Maybe you can try an approach like I shared in this August 5th post.
Otherwise if you can share a small reproducible example of what you want to do that can help us help you.
I hope this helps!