Skip to content

Commit 1f166ba

Browse files
vsmigx/vs_migraphx.cpp: relax restrictions on strides
proposed by @TheFeelTrain
1 parent 3addbbd commit 1f166ba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vsmigx/vs_migraphx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static void VS_CC vsMIGXCreate(
850850
{
851851
size_t target = 1; // MIGX uses elements to measure strides
852852
for (int i = static_cast<int>(ndim) - 1; i >= 0; i--) {
853-
if (strides[i] != target) {
853+
if (lengths[i] > 1 && strides[i] != target) {
854854
return set_error(
855855
"invalid stride for NCHW, expects " +
856856
std::to_string(target) +
@@ -914,7 +914,7 @@ static void VS_CC vsMIGXCreate(
914914
{
915915
size_t target = 1; // MIGX uses elements to measure strides
916916
for (int i = static_cast<int>(ndim) - 1; i >= 0; i--) {
917-
if (strides[i] != target) {
917+
if (lengths[i] > 1 && strides[i] != target) {
918918
return set_error(
919919
"invalid stride for NCHW, expects " +
920920
std::to_string(target) +

0 commit comments

Comments
 (0)