Solved by JuanFMontesinos in post #4 
              
              
                yep because it inspects what you return and I think if you return lists (maybe dicts) it inspects inside and if there are tensors it will just try to stack them. 
You can try to return dictionaries (dunno if it inspect that) and if it does fail you can wrap everything in a dummy object. 
As another …