From b889a0cee25ad81f02e740f1f2942fecfca8e11b Mon Sep 17 00:00:00 2001 From: pangyoki Date: Mon, 16 Nov 2020 16:45:45 +0800 Subject: [PATCH] add gaussian_random op_version (#28602) --- paddle/fluid/operators/gaussian_random_op.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/paddle/fluid/operators/gaussian_random_op.cc b/paddle/fluid/operators/gaussian_random_op.cc index 17a71c67b8a..fd2f48265ca 100644 --- a/paddle/fluid/operators/gaussian_random_op.cc +++ b/paddle/fluid/operators/gaussian_random_op.cc @@ -16,6 +16,7 @@ limitations under the License. */ #include "paddle/fluid/framework/generator.h" #include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/op_version_registry.h" #include "paddle/fluid/operators/fill_constant_op.h" #ifdef PADDLE_WITH_MKLDNN #include "paddle/fluid/platform/mkldnn_helper.h" @@ -197,3 +198,19 @@ REGISTER_OP_CPU_KERNEL(gaussian_random, ops::CPUGaussianRandomKernel, REGISTER_OP_CPU_KERNEL(gaussian_random_batch_size_like, ops::CPUGaussianRandomBatchSizeLikeKernel, ops::CPUGaussianRandomBatchSizeLikeKernel); +REGISTER_OP_VERSION(gaussian_random) + .AddCheckpoint( + R"ROC( + Upgrade gaussian_random add new inputs [ShapeTensor] and [ShapeTensorList] + and modify the attribute of [shape])ROC", + paddle::framework::compatible::OpVersionDesc() + .NewInput("ShapeTensor", + "The output shape supports Tensor type. ShapeTensor is " + "dispensable.") + .NewInput("ShapeTensorList", + "The output shape supports list filled with Tensor. " + "ShapeTensorList is dispensable.") + .ModifyAttr( + "shape", + "Add the default value of shape, the default value is {}.", + {})); -- GitLab