Skip to content

Commit

Permalink
[Paddle-TRT] Fix cast (#44312)
Browse files Browse the repository at this point in the history
* fix_cast

* fix_cast

* commit
  • Loading branch information
zhoutianzi666 authored Jul 18, 2022
1 parent 5c29173 commit 7a85ced
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/fluid/inference/tensorrt/op_teller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,10 @@ bool OpTeller::Tell(const framework::ir::Node* node,
}

if (op_type == "cast") {
// trt 6015 result in Windows ppyolo_mbv3 TRT fp32 diff
#if !IS_TRT_VERSION_GE(7000)
return false;
#endif
int in_dtype = BOOST_GET_CONST(int, desc.GetAttr("in_dtype"));
int out_dtype = BOOST_GET_CONST(int, desc.GetAttr("out_dtype"));
if ((in_dtype == 4 || in_dtype == 5) && out_dtype == 4) {
Expand Down

0 comments on commit 7a85ced

Please sign in to comment.