31 for (M i = 0; i < multiplier; ++i)
33 const T *in_end = in_data + in_size;
34 T *new_out_data = std::copy(in_data, in_end, out_data);
36 out_data = new_out_data;
42 const M *multipliers, T *out_data,
int dimension)
44 const int dimension_size = in_dimensions.
Dims(dimension);
48 return std::make_pair(dimension_size,
49 dimension_size *
static_cast<int>(multipliers[dimension]));
51 int total_stride_size = 0, total_tiled_stride_size = 0;
52 const T *copy_from_data = in_data;
53 T *copy_to_data = out_data;
54 for (
int i = 0; i < dimension_size; ++i)
56 int stride_size = 0, tiled_stride_size = 0;
57 std::tie(stride_size, tiled_stride_size) =
58 TileOneDimension(in_dimensions, copy_from_data, multipliers, copy_to_data, dimension + 1);
59 copy_from_data += stride_size;
60 copy_to_data += tiled_stride_size;
61 total_stride_size += stride_size;
62 total_tiled_stride_size += tiled_stride_size;
65 out_data + total_tiled_stride_size);
66 return std::make_pair(total_stride_size,
67 static_cast<int>(total_tiled_stride_size * multipliers[dimension]));
std::pair< int, int > TileOneDimension(const Shape &in_dimensions, const T *in_data, const M *multipliers, T *out_data, int dimension)