pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

ENH: Implement `pt.pad`

Open jessegrabowski opened this issue 1 year ago • 0 comments

Description

Numpy, along with derivative tensor libraries like jax, torch, etc, all offer padding functions to insert values to the left and right (and top and bottom, etc) to a tensor. We should probably have this as well. It shouldn't be too difficult (famous last words) -- I see it essentially as some shape computation followed by an AllocSubtensor, although we could certainly try to figure out the best way to do this.

jessegrabowski avatar May 03 '24 07:05 jessegrabowski