Repository navigation
[Infer Symbolic Shape No.27][BUAA]edit_distance - #67117
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
|
|
||
| infer_context->AddEqualCstr(hypslength_shape_or_data.shape()[0], | ||
| hyps_dims[0]); | ||
|
|
There was a problem hiding this comment.
这个分支里这四个值的0维都是相等的,是不是少了一个约束
There was a problem hiding this comment.
我再添加一个 infer_context->AddEqualCstr(hypslength_shape_or_data, refslength_shape_or_data); 吗?
|
这个 Coverage 的测试本地好像测不出来问题,请问后续应该如何修改呢? |
|
test/legacy_test/test_edit_distance_op.py 中 check_pir flag为默认关闭状态,申请approve coverage流水线 |
| } | ||
|
|
||
| infer_context->SetShapeOrDataForValue(op->result(0), refs_shape_or_data); | ||
| symbol::ShapeOrData<symbol::DimExpr> single_dim_expr({symbol::DimExpr(1)}); |
There was a problem hiding this comment.
symbol::ShapeOrDataDimExprs{symbol::TensorShapeOrDataDimExprs(
std::vectorsymbol::DimExpr{DimExpr(1)})} 这地方这么写吧
There was a problem hiding this comment.
这里给出的命令有一点小问题,我做了适当变化。
| symbol::DimExpr hyps_dim = symbol::DimExpr(hyps_dims[1]); | ||
| symbol::DimExpr refs_dim = symbol::DimExpr(refs_dims[1]); | ||
|
|
||
| infer_context->AddEqualCstr(hyps_dim, one); | ||
| infer_context->AddEqualCstr(refs_dim, one); |
There was a problem hiding this comment.
AddEqualCstr 里的 hyps_dim 可以直接用 hyps_dims[1] 吧?
| infer_context->AddEqualCstr(refs_dim, one); | ||
| } | ||
|
|
||
| infer_context->SetShapeOrDataForValue(op->result(0), refs_shape_or_data); |
There was a problem hiding this comment.
这样有可能把data也传入,建议再确认下
| symbol::ShapeOrDataDimExprs refs_shape_or_data_exprs( | ||
| symbol::TensorShapeOrDataDimExprs( | ||
| std::vector<symbol::DimExpr>{refs_dims})); | ||
| infer_context->SetShapeOrDataForValue(op->result(0), | ||
| refs_shape_or_data_exprs); |
There was a problem hiding this comment.
这里命名最好用out_shape_or_data_exprs,out和refs的shape相同,你这里的操作相当于是把refs的shape区取出来给out的符号表达初始化,可以下一个PR顺带修改下
* Finished kldiv loss op * Finished kldiv loss op * Fixed name issues * Resolved comments in #67117
* Fixd edit_distance op * Added one more constraint * Added one more constraint * Resolved suggested changes * Added symbol:: before DimExpr * Fixed errors * Removed two unnecessary variables and added .shape() * Fixed typos * Revert to a previous version * added .shape() * added .shape * added .shape() * Try to resolve type conflicts * Try to resolve type conflicts * Try to resolve type conflicts * Try to resolve type conflicts
…Paddle#67327) * Finished kldiv loss op * Finished kldiv loss op * Fixed name issues * Resolved comments in PaddlePaddle#67117
PR Category
CINN
PR Types
Others
Description
修改了
edit_distance算子。因为我刚开始做 CINN,对于相关的内容还不太熟悉,所以这个我先单独提交的。此前给出的修改意见在 #66870 中,我针对修改意见做了修改。