diff --git a/paddle/phi/core/ddim.h b/paddle/phi/core/ddim.h old mode 100755 new mode 100644 index 8003df7fd6842d286b037679d4c71dd9257ac353..f3bd8386c1bad9b9790054eb1f7873f6e601f8aa --- a/paddle/phi/core/ddim.h +++ b/paddle/phi/core/ddim.h @@ -18,7 +18,7 @@ #include #include -#include "paddle/phi/core/enforce.h" +#include "paddle/phi/api/ext/exception.h" #include "paddle/phi/core/utils/dim.h" namespace phi { @@ -29,23 +29,25 @@ namespace phi { return (callback); \ } -#define PADDLE_VISIT_DDIM(rank, callback) \ - switch (rank) { \ - PADDLE_VISIT_DDIM_BASE(0, callback); \ - PADDLE_VISIT_DDIM_BASE(1, callback); \ - PADDLE_VISIT_DDIM_BASE(2, callback); \ - PADDLE_VISIT_DDIM_BASE(3, callback); \ - PADDLE_VISIT_DDIM_BASE(4, callback); \ - PADDLE_VISIT_DDIM_BASE(5, callback); \ - PADDLE_VISIT_DDIM_BASE(6, callback); \ - PADDLE_VISIT_DDIM_BASE(7, callback); \ - PADDLE_VISIT_DDIM_BASE(8, callback); \ - PADDLE_VISIT_DDIM_BASE(9, callback); \ - default: \ - PADDLE_THROW(phi::errors::Unimplemented( \ - "Invalid dimension to be accessed. Now only supports access to " \ - "dimension 0 to 9, but received dimension is %d.", \ - rank)); \ +#define PADDLE_VISIT_DDIM(rank, callback) \ + switch (rank) { \ + PADDLE_VISIT_DDIM_BASE(0, callback); \ + PADDLE_VISIT_DDIM_BASE(1, callback); \ + PADDLE_VISIT_DDIM_BASE(2, callback); \ + PADDLE_VISIT_DDIM_BASE(3, callback); \ + PADDLE_VISIT_DDIM_BASE(4, callback); \ + PADDLE_VISIT_DDIM_BASE(5, callback); \ + PADDLE_VISIT_DDIM_BASE(6, callback); \ + PADDLE_VISIT_DDIM_BASE(7, callback); \ + PADDLE_VISIT_DDIM_BASE(8, callback); \ + PADDLE_VISIT_DDIM_BASE(9, callback); \ + default: \ + PD_THROW( \ + "Unimplemented error. Invalid dimension to be accessed. Now only " \ + "supports access to " \ + "dimension 0 to 9, but received dimension is ", \ + rank, \ + "."); \ } template