提交 b59c1063 编写于 作者: H Haihao Shen

Add missing reshape found by GM

上级 debbe33c
......@@ -35,6 +35,13 @@ using platform::GetMKLDNNFormat;
template <typename DeviceContext, typename T>
class DeQuantOpKernel : public framework::OpKernel<T> {
public:
void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInput("Input"), "Input should not be null");
PADDLE_ENFORCE(ctx->HasOutput("Output"), "Output should not be null");
ctx->SetOutputDim("Output", ctx->GetInputDim("Input"));
ctx->ShareLoD("Input", /*->*/ "Output");
}
void Compute(const framework::ExecutionContext& ctx) const override {
auto* input = ctx.Input<Tensor>("Input");
......
......@@ -33,6 +33,14 @@ using platform::GetMKLDNNFormat;
template <typename DeviceContext, typename T>
class QuantOpKernel : public framework::OpKernel<T> {
public:
void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInput("Input"), "Input should not be null");
PADDLE_ENFORCE(ctx->HasOutput("Output"), "Output should not be null");
ctx->SetOutputDim("Output", ctx->GetInputDim("Input"));
ctx->ShareLoD("Input", /*->*/ "Output");
}
void Compute(const framework::ExecutionContext& ctx) const override {
auto* input = ctx.Input<Tensor>("Input");
auto* scale = ctx.Input<Tensor>("Scale");
......
......@@ -34,6 +34,14 @@ using platform::GetMKLDNNFormat;
template <typename DeviceContext, typename T>
class ReQuantOpKernel : public framework::OpKernel<T> {
public:
void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInput("Input"), "Input should not be null");
PADDLE_ENFORCE(ctx->HasOutput("Output"), "Output should not be null");
ctx->SetOutputDim("Output", ctx->GetInputDim("Input"));
ctx->ShareLoD("Input", /*->*/ "Output");
}
void Compute(const framework::ExecutionContext& ctx) const override {
auto* input = ctx.Input<Tensor>("Input");
auto* scale = ctx.Input<Tensor>("Scale");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册