Skip to content

Conversation

@AndPuQing
Copy link
Contributor

@AndPuQing AndPuQing commented Dec 3, 2024

PR Category

CINN

PR Types

New features

Description

  • test_stride_slice_op 中原本单侧TestStridedSliceAPITestStridedSliceTensorArray 无法通过
  • 对于测试startsendsstridesInputs 的单测因无法在运行前得到,所以禁用

@paddle-bot
Copy link

paddle-bot bot commented Dec 3, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Dec 3, 2024
ExprVec ends = slice_utils::GetExprVecFromData(ends_shape_data);
ExprVec strides = slice_utils::GetExprVecFromData(strides_shape_data);

std::vector<int64_t> axes_vec = details::GetVectorAttr(op, "axes");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以先尝试添加一个 Int32 的特化模版

@AndPuQing AndPuQing marked this pull request as ready for review December 3, 2024 13:56
@gongshaotian
Copy link
Contributor

规范下 Description

@gongshaotian
Copy link
Contributor

TestStridedSliceAPI 和 TestStridedSliceTensorArray 的单测问题交由 @kevincheng2 修复

return slice_dims;
}

inline ShapeOrData StridedSliceRawInferSymbolicShape(
Copy link
Contributor

@zyfncg zyfncg Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StridedSliceRawInferSymbolicShape这个函数为什么放到infer_sym_slice_utils.h文件中?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SliceRawInferSymbolicShape 也放在utils.h里了,放一起容易维护

symbol::TensorShapeOrDataDimExprs(out_dims)};
};

// When `pd.slice` is operating on a tensor which is produced by a `pd.shape`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是 strided_slice 吧

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以放下个PR修改

Comment on lines +3506 to +3507
std::vector<int64_t>{},
std::vector<int64_t>{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确认一下,infer_flags_raw 和 decrease_axis 默认都是空有问题吗

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是因为

  • stride_slice 并未注册这两个参数,导致无法通过 GetVectorAttr 得到的
  • StridedSliceRawInferSymbolicShape 复用了 sliceGetDecreasedDims 所以对 decrease_axis 这里构造了空向量,而 infer_flags 这个参数是一个无效参数,在 slicestride_slice 均没有用到

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

@gongshaotian
Copy link
Contributor

原PR:#69290

@gongshaotian
Copy link
Contributor

APPROVAL 流水线发现了一些报错信息规范的问题,可以与注释一起提pr修改,连带检查下slice的几个工具函数里是不是报错信息也不规范

@luotao1 luotao1 merged commit d72d6ad into PaddlePaddle:develop Dec 4, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants