From 6159f5db14b580fab0386fdbe258b26c892be257 Mon Sep 17 00:00:00 2001 From: zchen0211 Date: Tue, 8 Aug 2017 16:38:51 -0700 Subject: [PATCH] code style fix --- paddle/operators/gather.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/paddle/operators/gather.h b/paddle/operators/gather.h index 5adc1e6b179..8b021565450 100644 --- a/paddle/operators/gather.h +++ b/paddle/operators/gather.h @@ -28,11 +28,8 @@ namespace operators { /* Implementation of CPU copy */ template -void CPUGather(const T* params, - const int* indices, - const int slice_size, - const int index_size, - T* output) { +void CPUGather(const T* params, const int* indices, const int slice_size, + const int index_size, T* output) { const size_t slice_bytes = slice_size * sizeof(T); for (size_t i = 0; i < index_size; ++i) { @@ -47,11 +44,8 @@ void CPUGather(const T* params, d = cuda_stream(gpu_id_, stream_id_); */ template -void GPUGather(const T* src, - const int* index, - const int slice_size, - const int index_size, - T* output); +void GPUGather(const T* src, const int* index, const int slice_size, + const int index_size, T* output); /** * Return a new tensor from source tensor, gathered according to index @@ -60,8 +54,7 @@ void GPUGather(const T* src, * return: output tensor */ template -void Gather(const platform::Place& place, - const paddle::framework::Tensor* src, +void Gather(const platform::Place& place, const paddle::framework::Tensor* src, const paddle::framework::Tensor* index, paddle::framework::Tensor* output) { // check index of shape 1-D @@ -78,10 +71,7 @@ void Gather(const platform::Place& place, // Gathering if (platform::is_cpu_place(place)) { - CPUGather(src->data(), - index->data(), - slice_size, - index_size, + CPUGather(src->data(), index->data(), slice_size, index_size, output->data()); } else { // init for GPU -- GitLab