@leslie-fang-intel
Sry, missed this message.
Can you test
torch::jit::pop(*stack).to<c10::optional<your_type>>()?
If it doesn’t work, please change the category to jit, there will be jit people there help you.