Is there any function in Pytensor can convert np arrays to tensors

I don’t understand what you mean by “better”. If you mean “one that does the exact computation that I want”, I still suggest you use a scan, as I showed in this post. You will have 100% control over the output in this case.

Frankly though, it seems like your issues are just related to padding and slicing on the left and right of your data. You can likely accomplish what you want using conv1d_causal together with pt.concatenate. Here’s a gist showing how to accomplish every mode in numpy using slicing, padding, and conv1d_causal.