NVIDIA / MatX

An efficient C++17 GPU numerical computing library with Python-like syntax

Home Page:https://nvidia.github.io/MatX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEA] : Add a pad operator modeling padarray in MATLAB

luitjens opened this issue · comments

https://www.mathworks.com/help/images/ref/padarray.html

We should add a pad operator which functionally changes the size of a tensor and set's how out of bounds accesses get values. We should fully support padding pre, post, and both along with a pad value that can be a scalar value, circular, replicate, and symmetric.

auto op = pad(input, pad_shape, pad_type, direction);

Where
direction = [ matx::PRE, matx::POST, matx::BOTH]
pad_type: is either a scalar or an enum/functor to indicate circular, replicate, or symmetric.