diff --git a/paddle/fluid/operators/gaussian_random_op.cc b/paddle/fluid/operators/gaussian_random_op.cc index 17a71c67b8a084c114497eb97568e9b536161711..fd2f48265ca6f4613d273207de79f96c1d2bcbea 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 {}.", + {}));