From 2236286c508af7fd666e28363fa1eaf927bad548 Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Wed, 5 Apr 2023 10:25:59 +0800 Subject: [PATCH] [DDim Decouple enforce.h] Change enforce.h->exception.h (#52492) --- paddle/phi/core/ddim.h | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) mode change 100755 => 100644 paddle/phi/core/ddim.h diff --git a/paddle/phi/core/ddim.h b/paddle/phi/core/ddim.h old mode 100755 new mode 100644 index 8003df7fd68..f3bd8386c1b --- 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 -- GitLab