[Cherry-pick] zero-dim: support 0-D for getitem/setitem (#53441)
* support 0-D output and 0-D as indice in __getitem__ * fix tests * fix inference and UT * add unittest for setitem * fix xpu test * fix xpu 0-d * fix right value is 0d and index is List/Tensor * Hack__getitem__ from 0-d to 1-d with FLAGS_set_to_1d * change PHI_DECLARE_xxx to DECLARE_xxx since the change not merged to 2.5 * hack 1-D tensor to Scalar * throw warning at __getitem__, not slice_utils
Showing
想要评论请 注册 或 登录