Add "edge" mode to mx.pad (#1309)

* Add edge padding mode

* fix pad in pooling

* string arg instead of enum
This commit is contained in:
Alex Barron
2024-08-06 11:23:10 -07:00
committed by GitHub
parent 8c9f0278b9
commit 635ccd9e25
6 changed files with 102 additions and 18 deletions

View File

@@ -263,6 +263,7 @@ array pad(
const std::vector<int>& low_pad_size,
const std::vector<int>& high_pad_size,
const array& pad_value = array(0),
const std::string mode = "constant",
StreamOrDevice s = {});
/** Pad an array with a constant value along all axes */
@@ -270,16 +271,19 @@ array pad(
const array& a,
const std::vector<std::pair<int, int>>& pad_width,
const array& pad_value = array(0),
const std::string mode = "constant",
StreamOrDevice s = {});
array pad(
const array& a,
const std::pair<int, int>& pad_width,
const array& pad_value = array(0),
const std::string mode = "constant",
StreamOrDevice s = {});
array pad(
const array& a,
int pad_width,
const array& pad_value = array(0),
const std::string mode = "constant",
StreamOrDevice s = {});
/** Permutes the dimensions in reverse order. */