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

Add the infer shape for other two quantize ops

上级 4702eb8c
...@@ -28,7 +28,10 @@ class DeQuantOp : public framework::OperatorWithKernel { ...@@ -28,7 +28,10 @@ class DeQuantOp : public framework::OperatorWithKernel {
public: public:
using framework::OperatorWithKernel::OperatorWithKernel; using framework::OperatorWithKernel::OperatorWithKernel;
void InferShape(framework::InferShapeContext* ctx) const override {} void InferShape(framework::InferShapeContext* ctx) const override{
ctx->SetOutputDim("Output", ctx->GetInputDim("Input"));
ctx->ShareLoD("Input", /*->*/ "Output");
}
protected: protected:
framework::OpKernelType GetExpectedKernelType( framework::OpKernelType GetExpectedKernelType(
......
...@@ -29,7 +29,7 @@ class QuantOp : public framework::OperatorWithKernel { ...@@ -29,7 +29,7 @@ class QuantOp : public framework::OperatorWithKernel {
using framework::OperatorWithKernel::OperatorWithKernel; using framework::OperatorWithKernel::OperatorWithKernel;
void InferShape(framework::InferShapeContext* ctx) const override{ void InferShape(framework::InferShapeContext* ctx) const override{
ctx->SetOutputDim("Output", ctx->GetInputDim("Input")); ctx->SetOutputDim("Output", ctx->GetInputDim("Input"));
ctx->ShareLoD("Input", /*->*/ "Output"); ctx->ShareLoD("Input", /*->*/ "Output");
} }
......
...@@ -28,7 +28,10 @@ class ReQuantOp : public framework::OperatorWithKernel { ...@@ -28,7 +28,10 @@ class ReQuantOp : public framework::OperatorWithKernel {
public: public:
using framework::OperatorWithKernel::OperatorWithKernel; using framework::OperatorWithKernel::OperatorWithKernel;
void InferShape(framework::InferShapeContext* ctx) const override {} void InferShape(framework::InferShapeContext* ctx) const override{
ctx->SetOutputDim("Output", ctx->GetInputDim("Input"));
ctx->ShareLoD("Input", /*->*/ "Output");
}
protected: protected:
framework::OpKernelType GetExpectedKernelType( framework::OpKernelType GetExpectedKernelType(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册