Skip to content

Commit

Permalink
fix reduce_mean issue
Browse files Browse the repository at this point in the history
  • Loading branch information
b3602sss committed Jul 28, 2021
1 parent a43d53d commit f495c0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paddle/fluid/inference/tensorrt/op_teller.cc
Expand Up @@ -719,12 +719,14 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
VLOG(3) << "the " << op_type
<< " does not have attr (keep_dim or dim or "
"reduce_all)";
std::cout << "attr " << desc.HasAttr("keep_dim") << " "
<< desc.HasAttr("dim") << " " << desc.HasAttr("reduce_all");
return false;
}

// The batch size dimension cannot be reduced if it's not dynamic shape.
if (!with_dynamic_shape) {
if (desc.HasAttr("reduce_all")) return false;
if (BOOST_GET_CONST(bool, desc.GetAttr("reduce_all"))) return false;
std::vector<int32_t> dim =
BOOST_GET_CONST(std::vector<int32_t>, desc.GetAttr("dim"));
for (auto x : dim) {
Expand Down

1 comment on commit f495c0e

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.