fix softmax unittest float16 random error (#28480)

TCChenlong-patch-1
zhupengyang 4 years ago committed by GitHub
parent dc45561786
commit 47cbf61dd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -234,10 +234,6 @@ class SoftmaxOpGradMaker : public framework::SingleGradOpMaker<T> {
DECLARE_INPLACE_OP_INFERER(SoftmaxInplaceInferer, {"X", "Out"});
// NOTE(zjl): AVX implementation of SoftmaxGrad does not support in-place
DECLARE_CUDA_ONLY_INPLACE_OP_INFERER(SoftmaxGradInplaceInferer,
{"Out", framework::GradVarName("X")});
} // namespace operators
} // namespace paddle
@ -248,8 +244,7 @@ REGISTER_OPERATOR(softmax, ops::SoftmaxOp, ops::SoftmaxOpMaker,
ops::SoftmaxOpGradMaker<paddle::framework::OpDesc>,
ops::SoftmaxOpGradMaker<paddle::imperative::OpBase>,
ops::SoftmaxInplaceInferer);
REGISTER_OPERATOR(softmax_grad, ops::SoftmaxOpGrad,
ops::SoftmaxGradInplaceInferer);
REGISTER_OPERATOR(softmax_grad, ops::SoftmaxOpGrad);
REGISTER_OP_CPU_KERNEL(
softmax, ops::SoftmaxKernel<paddle::platform::CPUDeviceContext, float>,
ops::SoftmaxKernel<paddle::platform::CPUDeviceContext, double>);

Loading…
Cancel
Save