38 const int idx = std::floor(xn);
39 const int idy = std::floor(yn);
41 const float dx = xn - idx;
42 const float dy = yn - idy;
43 const float dx_1 = 1.0f - dx;
44 const float dy_1 = 1.0f - dy;
46 const T border_value = constant_border_value;
50 const float tl =
tensor_elem_at(in,
id, border_mode, border_value);
53 const float tr =
tensor_elem_at(in,
id, border_mode, border_value);
56 const float bl =
tensor_elem_at(in,
id, border_mode, border_value);
59 const float br =
tensor_elem_at(in,
id, border_mode, border_value);
61 return static_cast<T
>(tl * (dx_1 * dy_1) + tr * (dx * dy_1) + bl * (dx_1 * dy) + br * (dx * dy));
75 dst_shape.
set(1, std::ceil(
src.shape().x() /
static_cast<float>(chunk_width)));
80 uint8_t *out_ptr =
dst.data();
82 for(
int i = 0; i <
dst.num_elements(); i += chunk_width)
85 size_t coord_x = coord.
x();
86 coord.
set(0, coord.
y() * chunk_width);
87 coord.
set(1, coord_x / chunk_width);
89 const int num_elements = std::min<int>(chunk_width,
src.shape().x() - coord.
x());
91 std::copy_n(
static_cast<const uint8_t *
>(
src(coord)), num_elements *
src.element_size(), out_ptr);
93 out_ptr += chunk_width *
dst.element_size();
105 if((0 <= yn + 1) && (yn + 1 < height) && (0 <= xn + 1) && (xn + 1 < width))