-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
refine EngineIOConverter, and use io_convert in test_trt_activation_op #10495
Conversation
cudaMemcpyHostToHost, *stream_)); | ||
|
||
PADDLE_ENFORCE_EQ(0, cudaMemcpyAsync(out, in.data<float>(), size, | ||
cudaMemcpyHostToHost, *stream_)); |
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 DeiveceToDevice?
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.
Done
*/ | ||
class EngineInputConverter { | ||
class EngineIOConverter { |
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.
Add comments about how to register a convter from fluid to TRT or from TRT to fluid.
For example, a converter for a special Op called x
that from fluid to TRT will register as Fluid(x)->TRT
.
Or a special Layer in TRT called y
that convert output from TRT to fluid will register as TRT(y)->Fluid
.
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.
add some comments at first.
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
@@ -26,7 +27,7 @@ namespace paddle { | |||
namespace inference { | |||
namespace tensorrt { | |||
|
|||
void Compare(float input, float expect) { | |||
void Compare(const std::string op_type, float input, float expect) { |
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.
const string&
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.
I will correct in next PR.
EngineInputConverter
toEngineIOConverter
, which has two function:ConvertInput
(LoDTensor->ITensor) andConvertOutput
(ITensor -> LoDTensor)test_io_converter.cc
EngineIOConverter
in unit-testtest_activation_op.cc
cudaMemcpyAsync
inSetInputFromCPU