Thank you sooooooo much for your help! This works for me XD
I found the mem cost is a little bit high when plugged this part of code into my own. I guess it’s because the operation contiguous that copies the tensor input_windows twice in the memory. Is there any way to avoid the memory copy?