From f57efeb6d1a9b0b2aa46b8b55f519bdeafd83692 Mon Sep 17 00:00:00 2001 From: ktlichkid Date: Mon, 23 Apr 2018 16:04:47 +0800 Subject: [PATCH] Added GetExpectedKernelType and Debug message --- paddle/fluid/operators/beam_search_op.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/beam_search_op.cc b/paddle/fluid/operators/beam_search_op.cc index 0499d8cbef7..bee0a29e905 100644 --- a/paddle/fluid/operators/beam_search_op.cc +++ b/paddle/fluid/operators/beam_search_op.cc @@ -260,10 +260,13 @@ class BeamSearchOp : public framework::OperatorWithKernel { framework::OpKernelType GetExpectedKernelType( const framework::ExecutionContext &ctx) const override { std::cout << "Get Expected type 1\n"; - framework::OpKernelType kt = OperatorWithKernel::GetExpectedKernelType(ctx); + framework::OpKernelType kt = framework::OpKernelType( + framework::ToDataType( + ctx.Input("pre_ids")->type()), + platform::CPUPlace()); std::cout << "Get Expected type 2\n"; - kt.place_ = ctx.Input("pre_ids")->place(); - std::cout << "Get Expected type 3\n"; + // kt.place_ = ctx.Input("pre_ids")->place(); + // std::cout << "Get Expected type 3\n"; return kt; } /* -- GitLab