CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[CINN] Add InferSymbolicShapeInterface for pd_op.strided_slice #70541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… CINN-shapeinfer-7
… CINN-shapeinfer-7
This reverts commit 6374d3c.
… CINN-stride_slice
… CINN-stride_slice
你的PR提交成功,感谢你对开源项目的贡献! |
true, | ||
common::errors::InvalidArgument( | ||
"The size of axes must equal size of starts, ends, and strides.")); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
计算 out_dim 之前的stride、start、end的处理不太好跟 0-size 相关的逻辑对齐
{symbol::Max<symbol::DimExpr>({unnegativate_lists})}); | ||
} | ||
} else { | ||
out_dim = infer_context->GetNextSymName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start、end如果是符号的话,没法统一正负,上面的计算公式的正确性能保障吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不能保证正确,如果 start 是 -20,ends 是 -10,in_dim 是 10,或者 50 结果都不一样
Sorry to inform you that 9f63f17's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
} else if (start_positive_end_negative) { | ||
starts.at(i) = starts.at(i) - in_dims.at(axis); | ||
} else { | ||
PADDLE_THROW(common::errors::Fatal("Dead code")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
优化下报错信息
test/legacy_test/test_slice_op.py
Outdated
# 0-size test case | ||
# class TestCase7(TestSliceOp): | ||
# def config(self): | ||
# self.input = np.random.random([3, 4, 5, 6]).astype("float64") | ||
# self.starts = [-5] | ||
# self.ends = [-5] | ||
# self.axes = [1] | ||
# self.infer_flags = [1, 1, 1] | ||
# self.out = self.input[:, -5:-5, :, :] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
清理单测
|
||
def test_check_grad_normal(self): | ||
self.check_grad( | ||
['Input'], 'Out', max_relative_error=0.006, check_pir=True | ||
) | ||
|
||
|
||
# Test python API | ||
class TestStridedSliceAPI(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python API 存在报错,负责同学修复前暂时注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ePaddle#70541) * Enhance strided_slice operation with infer_flags and decrease_axis parameters * fix * fix * fix * fix * fix * fix * Revert "fix" This reverts commit 6374d3c. * fix * fix * fix bugs * fix bugs * fix bugs * add tests * refine code * refine code * refine code * refine code * refine code * fix bugs --------- Co-authored-by: PuQing <me@puqing.work>
…ePaddle#70541) * Enhance strided_slice operation with infer_flags and decrease_axis parameters * fix * fix * fix * fix * fix * fix * Revert "fix" This reverts commit 6374d3c. * fix * fix * fix bugs * fix bugs * fix bugs * add tests * refine code * refine code * refine code * refine code * refine code * fix bugs --------- Co-authored-by: PuQing <me@puqing.work>
PR Category
CINN
PR Types
Others
Description
Pcard-67164