     const Tensor* x = context.Input<Tensor>("X");
     Tensor* out = context.Output<Tensor>("Out");
     auto numel = x->numel();
-    T* x_data = (T*)x->data<T>();
+    const T* x_data = x->data<T>();
     auto input_dims = x->dims();
     float max_norm = context.Attr<float>("max_norm");
     float p = context.Attr<float>("p");

                        ops::CUDARenormKernel<double>);

REGISTER_OP_CUDA_KERNEL(renorm_grad, ops::CUDAGradRenormKernel<float>,
                        ops::CUDAGradRenormKernel<double>);
        ctx.Output<framework::Tensor>(framework::GradVarName("X"));

    auto numel = d_out->numel();
    const T* dout_data = d_out->data<T>();
    const T* x_data = x->data<T>();
    auto input_dims = x->dims();
    float max_norm = ctx.Attr<float>("max_norm");
    float p = ctx.Attr<float>("p");
