-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add not_equal trt converter #49393
Add not_equal trt converter #49393
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
另外建议not_equal_op.cc和equal_op.cc合并;test_trt_convert_*单测,not_equal也可以和equal公用
} | ||
layer = TRT_ENGINE_ADD_LAYER( | ||
engine_, ElementWise, *X, *Y, nvinfer1::ElementWiseOperation::kEQUAL); | ||
layer = engine_->network()->addUnary(layer->getOutput(0), nvinfer1::UnaryOperation::NOT) |
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.
用这种写法TRT_ENGINE_ADD_LAYER(engine_, Unary, *input, trt_op);
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.
用这种写法TRT_ENGINE_ADD_LAYER(engine_, Unary, *input, trt_op);
好的,已经修改
请问合并是什么意思?这样改动比较大我怕我改出问题 |
放一个文件,主要是逻辑基本一致 |
合并后 只需要一个.cc 那具体的分支要在哪体现呢(就是具体的什么时候走equal什么时候走notequal) |
类似 至于单测,因为逻辑完全一致,没有必要新建一个文件,增加一个op_type 就行。 |
OK 已修改完毕 |
{ | ||
"op_type": "not_equal", | ||
"op_inputs": { | ||
"X": ["input_data1"], | ||
"Y": ["input_data2"], | ||
}, | ||
"op_outputs": {"Out": ["compare_output_data"]}, | ||
"op_attrs": dics[0], | ||
}, |
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_type改成变量,单测加一层for循环进行赋值
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_type改成变量,单测加一层for循环进行赋值
好的 已修改
layer = TRT_ENGINE_ADD_LAYER( | ||
engine_, ElementWise, *X, *Y, NOT(nvinfer1::ElementWiseOperation::kEQUAL)); | ||
|
||
layer = TRT_ENGINE_ADD_LAYER( | ||
engine_, Unary, *layer->getOutput(0), nvinfer1::UnaryOperation::kNOT); |
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.
这里格式有问题,参考代码贡献流程,确保通过pre-commit检查
"X": ["input_data1"], | ||
"Y": ["input_data2"], | ||
|
||
for op_type in ["equal","not_equal"]: |
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.
格式问题,"equal","not_equal" 之间需要空格
@sanbuphy
|
收到,已经修改,谢谢 |
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
layer = TRT_ENGINE_ADD_LAYER( | ||
engine_, Unary, *layer->getOutput(0), nvinfer1::UnaryOperation::kNOT); | ||
|
||
RreplenishLayerAndOutput(layer, "equal", {output_name}, test_mode); |
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.
这里写not_equal
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
Coverage流水线由于CI环境问题豁免 |
PR types
Others
PR changes
Others
Describe
Add not_equal trt converter
#48292