From 64589a7dc919c85295387058cecf6a72ed857c80 Mon Sep 17 00:00:00 2001 From: "jijoong.moon" Date: Mon, 27 Mar 2023 13:22:49 +0900 Subject: [PATCH] [ Tensor ] allow to have inc 0 for broadcasting for raw computation This PR allows to have 0 for incX and incY in tensor raw compuation to enable broadcasting tensor operation. **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon --- nntrainer/tensor/blas_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nntrainer/tensor/blas_interface.cpp b/nntrainer/tensor/blas_interface.cpp index 3c7beba..e413f38 100644 --- a/nntrainer/tensor/blas_interface.cpp +++ b/nntrainer/tensor/blas_interface.cpp @@ -34,7 +34,7 @@ namespace nntrainer { static void saxpy_raw(const unsigned int N, const float alpha, const float *X, const int incX, float *Y, const int incY) { - if (incX <= 0 or incY <= 0) + if (incX < 0 or incY < 0) throw std::invalid_argument( "Error: negative inc not supported without cblas"); for (unsigned int i = 0; i < N; ++i) -- 2.7.4