CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SCU][Paddle TensorRT No.26、29] Add (pd_op.logical_or、pd_op.logical_or、pd_op.logical_and) converter #69706
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
你的PR提交成功,感谢你对开源项目的贡献! |
return false; | ||
} | ||
#if IS_TRT_VERSION_LT(8400) | ||
VLOG(3) << "pd_op.logical_or op is not supported when TensorRT < 8.4"; |
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.
小于8.4只是不支持静态shape
op->attribute<pir::BoolAttribute>(kCanRunTrtAttr).data()) { | ||
return false; | ||
} | ||
#if IS_TRT_VERSION_LT(8400) |
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_trt_result(self): | ||
self.api_args = { | ||
"x": np.random.choice([True, False], size=(3,)).astype("bool"), |
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.
这是什么输入方式。。改成普通的np.random.random就可以
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.
我这里的理解是logical_or只支持bool类型输入,np.random.random转成bool就基本全是true了
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.
另外,这里加两个单测,测试Marker,这样ci单测覆盖率能够
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.
已经有两个Marker的单测了,请问还需要再添加吗
@@ -1174,6 +1174,53 @@ class LessThanOpPattern | |||
return true; | |||
} | |||
}; | |||
|
|||
class LogicalOrOpPattern |
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.
LogicalOrOpPattern和LogicalOr_OpPattern有大量代码重复,建议复用
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.
感谢review!已提交新的commit
auto x_dtype = pir::GetDataTypeFromValue(x); | ||
auto y_dtype = pir::GetDataTypeFromValue(y); | ||
if (!(x_dtype.isa<pir::BoolType>() && y_dtype.isa<pir::BoolType>())) { | ||
VLOG(3) << "pd_op.logical_or op only supports bool datatype"; |
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.
这个代码应该也适用于其余Op,这里写死了pd_op.logical_or不太妥当,看下OpType有没有拿到name的方法
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.
好的
PR Category
Inference
PR Types
New features
Description
新增了
pd_op.logical_or
、pd_op.logical_or_
Marker和Converter