im2col.cc 18.3 KB
Newer Older
1
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
H
hedaoyuan 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

Y
Yi Wang 已提交
15
#include "paddle/fluid/operators/math/im2col.h"
16
#include <vector>
H
hedaoyuan 已提交
17 18

namespace paddle {
19
namespace operators {
20
namespace math {
H
hedaoyuan 已提交
21 22

/*
H
hedaoyuan 已提交
23 24 25
 * im = [input_channels, input_height, input_width]
 * col =
 *   [input_channels, filter_height, filter_width, output_height, output_width]
H
hedaoyuan 已提交
26 27
 */
template <class T>
H
hedaoyuan 已提交
28
class Im2ColFunctor<paddle::operators::math::ColFormat::kCFO,
Q
QI JUN 已提交
29
                    platform::CPUDeviceContext, T> {
H
hedaoyuan 已提交
30
 public:
Q
QI JUN 已提交
31
  void operator()(const platform::CPUDeviceContext& context,
C
chengduoZH 已提交
32 33 34
                  const framework::Tensor& im, const std::vector<int>& dilation,
                  const std::vector<int>& stride,
                  const std::vector<int>& padding, framework::Tensor* col) {
H
hedaoyuan 已提交
35
    PADDLE_ENFORCE(im.dims().size() == 3);
C
chengduoZH 已提交
36
    PADDLE_ENFORCE(col->dims().size() == 5);
H
hedaoyuan 已提交
37

C
chengduoZH 已提交
38 39 40
    int im_channels = im.dims()[0];
    int im_height = im.dims()[1];
    int im_width = im.dims()[2];
C
chengduoZH 已提交
41 42
    int filter_height = col->dims()[1];
    int filter_width = col->dims()[2];
T
tensor-tang 已提交
43 44
    int output_height = col->dims()[3];
    int output_width = col->dims()[4];
C
chengduoZH 已提交
45

C
chengduoZH 已提交
46
    int channels_col = im_channels * filter_height * filter_width;
H
hedaoyuan 已提交
47 48

    const T* im_data = im.data<T>();
C
chengduoZH 已提交
49
    T* col_data = col->data<T>();
T
tensor-tang 已提交
50
    // TODO(TJ): change me to template
51
    // further optimize: padding == 1 need special
T
tensor-tang 已提交
52
    if (stride[0] == 1 && stride[1] == 1 && dilation[0] == 1 &&
53
        dilation[1] == 1) {
T
tensor-tang 已提交
54
      int col_matrix_width = output_width * output_height;
T
tensor-tang 已提交
55
      int im_size = im_height * im_width;
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
      if (padding[0] == 0 && padding[1] == 0) {
        size_t copy_size = sizeof(T) * output_width;
        for (int oh = 0; oh < output_height; ++oh) {
          const T* im_data_start = im_data + oh * im_width;
          T* dst_data = col_data + oh * output_width;
          for (int ic = 0; ic < im_channels; ++ic) {
            const T* src_data = im_data_start + ic * im_size;
            for (int kh = 0; kh < filter_height; ++kh) {
              for (int kw = 0; kw < filter_width; ++kw) {
                std::memcpy(dst_data, src_data + kw, copy_size);
                dst_data = dst_data + col_matrix_width;
              }
              src_data = src_data + im_width;
            }
          }
        }
        return;
      } else {
        int plh = padding[0];
T
tensor-tang 已提交
75
        int plw = padding[1];
76 77
        int prh =
            (output_height - 1) * stride[0] + filter_height - im_height - plh;
T
tensor-tang 已提交
78 79
        int prw =
            (output_width - 1) * stride[1] + filter_width - im_width - plw;
80 81

        // fill height padding : 0 ~ plh-1, (oh-prh) ~ (oh-1)
T
tensor-tang 已提交
82
        // TODO(TJ): refine ph*xxx
83
        assert(plh == prh);  // because stride_h == 1
T
tensor-tang 已提交
84 85
        int col_block_fh = filter_width * col_matrix_width;  // fw*oh*ow
        int col_block_ic = filter_height * col_block_fh;     // fh*fw*oh*ow
86
        for (int ph = 0; ph < plh; ++ph) {
T
tensor-tang 已提交
87 88 89 90 91
          int sz = output_width * (plh - ph);
          size_t copy_sz = sizeof(T) * sz;
          T* col_start_l = col_data + ph * col_block_fh;
          T* col_start_r = col_data + (filter_height - ph - 1) * col_block_fh +
                           col_matrix_width - sz;
92
          for (int ic = 0; ic < im_channels; ++ic) {
T
tensor-tang 已提交
93 94
            T* dst_data_l = col_start_l + ic * col_block_ic;
            T* dst_data_r = col_start_r + ic * col_block_ic;
T
tensor-tang 已提交
95
            for (int kw = 0; kw < filter_width; ++kw) {
T
tensor-tang 已提交
96 97
              std::memset(dst_data_l, 0, copy_sz);
              std::memset(dst_data_r, 0, copy_sz);
98 99
              dst_data_l = dst_data_l + col_matrix_width;
              dst_data_r = dst_data_r + col_matrix_width;
T
tensor-tang 已提交
100 101 102
            }
          }
        }
T
tensor-tang 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128

        // fill width padding
        assert(plw == prw);  // because stride_w == 1
        if (plw == 1) {
          auto pad = static_cast<T>(0);  // padding zero
          for (int ic = 0; ic < im_channels; ++ic) {
            // TODO(TJ): use add and resue stride
            T* dst_data_ic = col_data + ic * col_block_ic;
            for (int kh = 0; kh < filter_height; ++kh) {
              T* dst_data_kh = dst_data_ic + kh * col_block_fh;
              for (T* dst_data :
                   {dst_data_kh, dst_data_kh +
                                     (filter_width - prw) * col_matrix_width +
                                     output_width - 1}) {
                // TODO(TJ): from plh, saving repeated assignment
                for (int oh = 0; oh < output_height; ++oh) {
                  *dst_data = pad;
                  dst_data = dst_data + output_width;
                }
              }
            }
          }
        } else {
          // padding_size > 1
          for (int ic = 0; ic < im_channels; ++ic) {
            // TODO(TJ): use add and resue stride
129
            T* dst_data_ic = col_data + ic * col_block_ic;
T
tensor-tang 已提交
130
            for (int kh = 0; kh < filter_height; ++kh) {
131
              T* dst_data_kh = dst_data_ic + kh * col_block_fh;
T
tensor-tang 已提交
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
              for (int kw = 0; kw < plw; ++kw) {
                // TODO(TJ): reuse array outside this for
                size_t sz = sizeof(T) * (plw - kw);
                T* dst_data = dst_data_kh + kw * col_matrix_width;
                // TODO(TJ): from plh, saving repeated assignment
                for (int oh = 0; oh < output_height; ++oh) {
                  std::memset(dst_data, 0, sz);
                  dst_data = dst_data + output_width;
                }
              }
              // TODO(TJ): use reverse to save cache
              for (int kw = 0; kw < prw; ++kw) {
                // TODO(TJ): reuse array outside this for
                auto num = (prw - kw);
                size_t sz = sizeof(T) * num;
                T* dst_data = dst_data_kh +
                              (filter_width - 1 - kw) * col_matrix_width +
                              output_width - num;
                // TODO(TJ): from plh, saving repeated assignment
                for (int oh = 0; oh < output_height; ++oh) {
                  std::memset(dst_data, 0, sz);
                  dst_data = dst_data + output_width;
                }
              }
            }
          }
        }
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219

        // fill im_data
        // padding cover two cases:
        // 1. kw > 2*pw: kw = 3, pw = 1
        // 0 x x x x ... x x x x 0
        // 1 1 1             1 1 1
        // ==>
        // 0 x ... x x
        // x x ... x x
        // x x ... x 0
        // 2. kw < 2*pw: kw = 3, pw = 2
        // 0 0 x x x ... x x x 0 0
        // 1 1 1             1 1 1
        // ==>
        // 0 0 x ... x x x
        // 0 x x ... x x 0
        // x x x ... x 0 0

        // TODO(TJ): use array like: size_t copy_size[kw]={sizeof(T) *
        // (output_width-1)}
        // length of copy_size is equal kw.
        if (plw + prw < filter_width) {
          for (int oh = 0; oh < output_height; ++oh) {
            const T* im_data_start =
                im_data + (oh - plh > 0 ? oh - plh : 0) * im_width;
            T* dst_data = col_data + oh * output_width;
            for (int ic = 0; ic < im_channels; ++ic) {
              const T* src_data = im_data_start + ic * im_size;
              for (int kh = 0; kh < filter_height; ++kh) {
                if ((oh < plh && kh < plh) ||
                    (oh > (output_height - prh - 1) &&
                     kh > (filter_height - prh - 1))) {
                  dst_data = dst_data + filter_width * col_matrix_width;
                  continue;
                }
                // TODO(TJ): reuse plw-kw outside this for
                // try to unify
                for (int kw = 0; kw < plw; ++kw) {
                  std::memcpy(dst_data + (plw - kw), src_data,
                              sizeof(T) * (output_width - (plw - kw)));
                  dst_data = dst_data + col_matrix_width;
                }
                for (int kw = plw; kw < filter_width - prw; ++kw) {
                  std::memcpy(dst_data, src_data + (kw - plw),
                              sizeof(T) * output_width);
                  dst_data = dst_data + col_matrix_width;
                }
                int i = 1;
                for (int kw = filter_width - prw; kw < filter_width;
                     ++kw, ++i) {
                  std::memcpy(dst_data, src_data + (kw - plw),
                              sizeof(T) * (output_width - i));
                  dst_data = dst_data + col_matrix_width;
                }
                src_data = src_data + im_width;
              }
            }
          }
        } else {
          LOG(FATAL) << "Not implement yet";
        }
220
        return;
T
tensor-tang 已提交
221 222 223
      }
    }

H
hedaoyuan 已提交
224
    for (int c = 0; c < channels_col; ++c) {
C
chengduoZH 已提交
225 226 227
      int w_offset = c % filter_width;
      int h_offset = (c / filter_width) % filter_height;
      int c_im = c / (filter_width * filter_height);
T
tensor-tang 已提交
228
      for (int h = 0; h < output_height; ++h) {
C
chengduoZH 已提交
229
        int im_row_idx = h * stride[0] - padding[0] + h_offset * dilation[0];
T
tensor-tang 已提交
230
        for (int w = 0; w < output_width; ++w) {
C
chengduoZH 已提交
231
          int im_col_idx = w * stride[1] - padding[1] + w_offset * dilation[1];
T
tensor-tang 已提交
232
          int col_idx = (c * output_height + h) * output_width + w;
C
chengduoZH 已提交
233
          int im_idx = (im_row_idx + c_im * im_height) * im_width + im_col_idx;
C
chengduoZH 已提交
234

C
chengduoZH 已提交
235 236 237 238
          col_data[col_idx] = (im_row_idx < 0 || im_row_idx >= im_height ||
                               im_col_idx < 0 || im_col_idx >= im_width)
                                  ? static_cast<T>(0)
                                  : im_data[im_idx];
H
hedaoyuan 已提交
239 240 241 242 243 244 245
        }
      }
    }
  }
};

/*
H
hedaoyuan 已提交
246 247 248
 * im = [input_channels, input_height, input_width]
 * col =
 *   [input_channels, filter_height, filter_width, output_height, output_width]
H
hedaoyuan 已提交
249 250
 */
template <class T>
H
hedaoyuan 已提交
251
class Col2ImFunctor<paddle::operators::math::ColFormat::kCFO,
Q
QI JUN 已提交
252
                    platform::CPUDeviceContext, T> {
H
hedaoyuan 已提交
253
 public:
Q
QI JUN 已提交
254
  void operator()(const platform::CPUDeviceContext& context,
C
chengduoZH 已提交
255 256 257 258 259
                  const framework::Tensor& col,
                  const std::vector<int>& dilation,
                  const std::vector<int>& stride,
                  const std::vector<int>& padding, framework::Tensor* im) {
    PADDLE_ENFORCE(im->dims().size() == 3);
H
hedaoyuan 已提交
260
    PADDLE_ENFORCE(col.dims().size() == 5);
C
chengduoZH 已提交
261 262 263
    int im_channels = im->dims()[0];
    int im_height = im->dims()[1];
    int im_width = im->dims()[2];
H
hedaoyuan 已提交
264 265
    int filter_height = col.dims()[1];
    int filter_width = col.dims()[2];
C
chengduoZH 已提交
266 267
    int col_height = col.dims()[3];
    int col_width = col.dims()[4];
C
chengduoZH 已提交
268

C
chengduoZH 已提交
269 270 271
    PADDLE_ENFORCE_EQ((im_height + padding[0] + padding[2] -
                       ((dilation[0] * (filter_height - 1) + 1))) /
                              stride[0] +
C
chengduoZH 已提交
272 273 274 275
                          1,
                      col_height,
                      "Output_height and padding(padding_up, padding_down) are "
                      "inconsistent.");
C
chengduoZH 已提交
276 277 278
    PADDLE_ENFORCE_EQ((im_width + padding[1] + padding[3] -
                       ((dilation[1] * (filter_width - 1) + 1))) /
                              stride[1] +
C
chengduoZH 已提交
279 280
                          1,
                      col_width,
C
chengduoZH 已提交
281
                      "Output_height and padding(padding_up, padding_down) are "
C
chengduoZH 已提交
282
                      "inconsistent.");
C
chengduoZH 已提交
283

C
chengduoZH 已提交
284
    int channels_col = im_channels * filter_height * filter_width;
H
hedaoyuan 已提交
285

C
chengduoZH 已提交
286
    T* im_data = im->data<T>();
H
hedaoyuan 已提交
287 288 289
    const T* col_data = col.data<T>();

    for (int c = 0; c < channels_col; ++c) {
C
chengduoZH 已提交
290 291 292
      int w_offset = c % filter_width;
      int h_offset = (c / filter_width) % filter_height;
      int c_im = c / (filter_width * filter_height);
C
chengduoZH 已提交
293
      for (int h = 0; h < col_height; ++h) {
C
chengduoZH 已提交
294
        int im_row_idx = h * stride[0] - padding[0] + h_offset * dilation[0];
C
chengduoZH 已提交
295
        for (int w = 0; w < col_width; ++w) {
C
chengduoZH 已提交
296
          int im_col_idx = w * stride[1] - padding[1] + w_offset * dilation[1];
C
chengduoZH 已提交
297 298
          if ((im_row_idx) >= 0 && (im_row_idx) < im_height &&
              (im_col_idx) >= 0 && (im_col_idx) < im_width) {
C
chengduoZH 已提交
299
            im_data[(im_row_idx + c_im * im_height) * im_width + im_col_idx] +=
C
chengduoZH 已提交
300
                col_data[(c * col_height + h) * col_width + w];
H
hedaoyuan 已提交
301 302 303 304 305 306 307
          }
        }
      }
    }
  }
};

H
hedaoyuan 已提交
308
template class Im2ColFunctor<paddle::operators::math::ColFormat::kCFO,
Q
QI JUN 已提交
309
                             platform::CPUDeviceContext, float>;
H
hedaoyuan 已提交
310
template class Im2ColFunctor<paddle::operators::math::ColFormat::kCFO,
Q
QI JUN 已提交
311
                             platform::CPUDeviceContext, double>;
H
hedaoyuan 已提交
312
template class Col2ImFunctor<paddle::operators::math::ColFormat::kCFO,
Q
QI JUN 已提交
313
                             platform::CPUDeviceContext, float>;
H
hedaoyuan 已提交
314
template class Col2ImFunctor<paddle::operators::math::ColFormat::kCFO,
Q
QI JUN 已提交
315
                             platform::CPUDeviceContext, double>;
H
hedaoyuan 已提交
316 317

/*
H
hedaoyuan 已提交
318 319 320
 * im = [input_channels, input_height, input_width]
 * col =
 *   [output_height, output_width, input_channels, filter_height, filter_width]
H
hedaoyuan 已提交
321 322
 */
template <class T>
H
hedaoyuan 已提交
323
class Im2ColFunctor<paddle::operators::math::ColFormat::kOCF,
Q
QI JUN 已提交
324
                    platform::CPUDeviceContext, T> {
H
hedaoyuan 已提交
325
 public:
Q
QI JUN 已提交
326
  void operator()(const platform::CPUDeviceContext& context,
C
chengduoZH 已提交
327 328 329
                  const framework::Tensor& im, const std::vector<int>& dilation,
                  const std::vector<int>& stride,
                  const std::vector<int>& padding, framework::Tensor* col) {
H
hedaoyuan 已提交
330
    PADDLE_ENFORCE(im.dims().size() == 3);
C
chengduoZH 已提交
331
    PADDLE_ENFORCE(col->dims().size() == 5);
C
chengduoZH 已提交
332 333 334
    int im_channels = im.dims()[0];
    int im_height = im.dims()[1];
    int im_width = im.dims()[2];
C
chengduoZH 已提交
335 336 337 338
    int filter_height = col->dims()[3];
    int filter_width = col->dims()[4];
    int col_height = col->dims()[0];
    int col_width = col->dims()[1];
H
hedaoyuan 已提交
339 340

    const T* im_data = im.data<T>();
C
chengduoZH 已提交
341
    T* col_data = col->data<T>();
H
hedaoyuan 已提交
342

C
chengduoZH 已提交
343 344 345
    for (int col_row_idx = 0; col_row_idx < col_height; ++col_row_idx) {
      for (int col_col_idx = 0; col_col_idx < col_width; ++col_col_idx) {
        for (int channel = 0; channel < im_channels; ++channel) {
H
hedaoyuan 已提交
346 347
          for (int filter_row_idx = 0; filter_row_idx < filter_height;
               ++filter_row_idx) {
C
refine  
chengduoZH 已提交
348 349
            int im_row_offset =
                col_row_idx * stride[0] + filter_row_idx - padding[0];
H
hedaoyuan 已提交
350 351 352
            for (int filter_col_idx = 0; filter_col_idx < filter_width;
                 ++filter_col_idx) {
              int im_col_offset =
C
chengduoZH 已提交
353
                  col_col_idx * stride[1] + filter_col_idx - padding[1];
C
refine  
chengduoZH 已提交
354

C
chengduoZH 已提交
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
              int col_offset =
                  ((((col_row_idx)*col_width + col_col_idx) * im_channels +
                    channel) *
                       filter_height +
                   filter_row_idx) *
                      filter_width +
                  filter_col_idx;

              int im_offset = (channel * im_height + im_row_offset) * im_width +
                              im_col_offset;
              col_data[col_offset] =
                  (im_row_offset < 0 || im_row_offset >= im_height ||
                   im_col_offset < 0 || im_col_offset >= im_width)
                      ? static_cast<T>(0)
                      : im_data[im_offset];
H
hedaoyuan 已提交
370 371 372 373 374 375 376 377 378
            }
          }
        }
      }
    }
  }
};

/*
H
hedaoyuan 已提交
379 380 381
 * im = [input_channels, input_height, input_width]
 * col =
 *   [output_height, output_width, input_channels, filter_height, filter_width]
H
hedaoyuan 已提交
382 383
 */
template <class T>
H
hedaoyuan 已提交
384
class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
Q
QI JUN 已提交
385
                    platform::CPUDeviceContext, T> {
H
hedaoyuan 已提交
386
 public:
Q
QI JUN 已提交
387
  void operator()(const platform::CPUDeviceContext& context,
C
chengduoZH 已提交
388 389 390 391 392
                  const framework::Tensor& col,
                  const std::vector<int>& dilation,
                  const std::vector<int>& stride,
                  const std::vector<int>& padding, framework::Tensor* im) {
    PADDLE_ENFORCE(im->dims().size() == 3);
H
hedaoyuan 已提交
393
    PADDLE_ENFORCE(col.dims().size() == 5);
C
chengduoZH 已提交
394 395 396
    int im_channels = im->dims()[0];
    int im_height = im->dims()[1];
    int im_width = im->dims()[2];
H
hedaoyuan 已提交
397 398
    int filter_height = col.dims()[3];
    int filter_width = col.dims()[4];
C
chengduoZH 已提交
399 400
    int col_height = col.dims()[0];
    int col_width = col.dims()[1];
H
hedaoyuan 已提交
401

C
chengduoZH 已提交
402 403 404 405 406 407 408 409 410 411
    PADDLE_ENFORCE_EQ(
        (im_height + padding[0] + padding[2] - filter_height) / stride[0] + 1,
        col_height,
        "Output_height and padding(padding_up, padding_down) are "
        "inconsistent.");
    PADDLE_ENFORCE_EQ(
        (im_width + padding[1] + padding[3] - filter_width) / stride[1] + 1,
        col_width,
        "col_width and padding(padding_left, padding_right) are "
        "inconsistent.");
412

C
chengduoZH 已提交
413
    T* im_data = im->data<T>();
H
hedaoyuan 已提交
414 415
    const T* col_data = col.data<T>();

C
chengduoZH 已提交
416 417 418
    for (int col_row_idx = 0; col_row_idx < col_height; ++col_row_idx) {
      for (int col_col_idx = 0; col_col_idx < col_width; ++col_col_idx) {
        for (int channel = 0; channel < im_channels; ++channel) {
H
hedaoyuan 已提交
419 420
          for (int filter_row_idx = 0; filter_row_idx < filter_height;
               ++filter_row_idx) {
C
refine  
chengduoZH 已提交
421 422
            int im_row_offset =
                col_row_idx * stride[0] + filter_row_idx - padding[0];
H
hedaoyuan 已提交
423 424 425
            for (int filter_col_idx = 0; filter_col_idx < filter_width;
                 ++filter_col_idx) {
              int im_col_offset =
C
chengduoZH 已提交
426
                  col_col_idx * stride[1] + filter_col_idx - padding[1];
C
refine  
chengduoZH 已提交
427

C
chengduoZH 已提交
428 429 430 431 432 433 434
              int col_offset =
                  (((col_row_idx * col_width + col_col_idx) * im_channels +
                    channel) *
                       filter_height +
                   filter_row_idx) *
                      filter_width +
                  filter_col_idx;
C
refine  
chengduoZH 已提交
435

C
chengduoZH 已提交
436 437
              if (im_row_offset >= 0 && im_row_offset < im_height &&
                  im_col_offset >= 0 && im_col_offset < im_width) {
H
hedaoyuan 已提交
438
                int im_offset =
C
chengduoZH 已提交
439
                    (channel * im_height + im_row_offset) * im_width +
H
hedaoyuan 已提交
440 441
                    im_col_offset;
                im_data[im_offset] += col_data[col_offset];
H
hedaoyuan 已提交
442 443 444 445 446 447 448 449 450
              }
            }
          }
        }
      }
    }
  }
};

H
hedaoyuan 已提交
451
template class Im2ColFunctor<paddle::operators::math::ColFormat::kOCF,
Q
QI JUN 已提交
452
                             platform::CPUDeviceContext, float>;
H
hedaoyuan 已提交
453
template class Im2ColFunctor<paddle::operators::math::ColFormat::kOCF,
Q
QI JUN 已提交
454
                             platform::CPUDeviceContext, double>;
H
hedaoyuan 已提交
455
template class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
Q
QI JUN 已提交
456
                             platform::CPUDeviceContext, float>;
H
hedaoyuan 已提交
457
template class Col2ImFunctor<paddle::operators::math::ColFormat::kOCF,
Q
QI JUN 已提交
458
                             platform::CPUDeviceContext, double>;
H
hedaoyuan 已提交
459

460
}  // namespace math
461
}  // namespace operators
H
hedaoyuan 已提交
462
}  // namespace paddle