提交 d9673cad 编写于 作者: S sweetsky0901

format code

上级 821899cc
...@@ -35,7 +35,7 @@ class Unpool2dMaxFunctor<platform::CPUPlace, T> { ...@@ -35,7 +35,7 @@ class Unpool2dMaxFunctor<platform::CPUPlace, T> {
int input_feasize = input_height * input_width; int input_feasize = input_height * input_width;
int output_feasize = output_height * output_width; int output_feasize = output_height * output_width;
const T* input_data = input.data<T>(); const T* input_data = input.data<T>();
const int * indices_data = indices.data<int>(); const int* indices_data = indices.data<int>();
T* output_data = output->mutable_data<T>(context.GetPlace()); T* output_data = output->mutable_data<T>(context.GetPlace());
for (int b = 0; b < batch_size; ++b) { for (int b = 0; b < batch_size; ++b) {
for (int c = 0; c < output_channels; ++c) { for (int c = 0; c < output_channels; ++c) {
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
const int output_width = output.dims()[3]; const int output_width = output.dims()[3];
int input_feasize = input_height * input_width; int input_feasize = input_height * input_width;
int output_feasize = output_height * output_width; int output_feasize = output_height * output_width;
const int * indices_data = indices.data<int>(); const int* indices_data = indices.data<int>();
const T* output_grad_data = output_grad.data<T>(); const T* output_grad_data = output_grad.data<T>();
T* input_grad_data = input_grad->mutable_data<T>(context.GetPlace()); T* input_grad_data = input_grad->mutable_data<T>(context.GetPlace());
......
...@@ -90,7 +90,7 @@ class Unpool2dMaxFunctor<platform::GPUPlace, T> { ...@@ -90,7 +90,7 @@ class Unpool2dMaxFunctor<platform::GPUPlace, T> {
const int output_height = output->dims()[2]; const int output_height = output->dims()[2];
const int output_width = output->dims()[3]; const int output_width = output->dims()[3];
const T* input_data = input.data<T>(); const T* input_data = input.data<T>();
const int * indices_data = indices.data<int>(); const int* indices_data = indices.data<int>();
T* output_data = output->mutable_data<T>(context.GetPlace()); T* output_data = output->mutable_data<T>(context.GetPlace());
int threads = 1024; int threads = 1024;
int grid = (input.numel() + threads - 1) / threads; int grid = (input.numel() + threads - 1) / threads;
...@@ -121,7 +121,7 @@ class Unpool2dMaxGradFunctor<platform::GPUPlace, T> { ...@@ -121,7 +121,7 @@ class Unpool2dMaxGradFunctor<platform::GPUPlace, T> {
const int output_height = output.dims()[2]; const int output_height = output.dims()[2];
const int output_width = output.dims()[3]; const int output_width = output.dims()[3];
const T* input_data = input.data<T>(); const T* input_data = input.data<T>();
const int * indices_data = indices.data<int>(); const int* indices_data = indices.data<int>();
const T* output_data = output.data<T>(); const T* output_data = output.data<T>();
const T* output_grad_data = output_grad.data<T>(); const T* output_grad_data = output_grad.data<T>();
T* input_grad_data = input_grad->mutable_data<T>(context.GetPlace()); T* input_grad_data = input_grad->mutable_data<T>(context.GetPlace());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册