@@ -19,9 +19,11 @@ namespace fastdeploy {
19
19
namespace function {
20
20
21
21
template <typename T, int Rank>
22
- void TileFunctor (const FDTensor& x, std::vector<int64_t > repeat_times,
22
+ void TileFunctor (const FDTensor& x,
23
+ const std::vector<int64_t >& origin_repeat_times,
23
24
FDTensor* out) {
24
25
auto x_shape = x.Shape ();
26
+ auto repeat_times = origin_repeat_times;
25
27
for (size_t i = 0 ; i < repeat_times.size (); ++i) {
26
28
FDASSERT (repeat_times[i] > 0 ,
27
29
" All elements of the input 'repeat_times' "
@@ -66,7 +68,7 @@ void TileFunctor(const FDTensor& x, std::vector<int64_t> repeat_times,
66
68
}
67
69
68
70
template <typename T>
69
- void TileKernel (const FDTensor& x, std::vector<int64_t > repeat_times,
71
+ void TileKernel (const FDTensor& x, const std::vector<int64_t >& repeat_times,
70
72
FDTensor* out) {
71
73
auto rank = x.Shape ().size ();
72
74
auto repeat_times_size = repeat_times.size ();
@@ -96,7 +98,8 @@ void TileKernel(const FDTensor& x, std::vector<int64_t> repeat_times,
96
98
}
97
99
}
98
100
99
- void Tile (const FDTensor& x, std::vector<int64_t > repeat_times, FDTensor* out) {
101
+ void Tile (const FDTensor& x, const std::vector<int64_t >& repeat_times,
102
+ FDTensor* out) {
100
103
FD_VISIT_ALL_TYPES (x.dtype , " TileKernel" ,
101
104
([&] { TileKernel<data_t >(x, repeat_times, out); }));
102
105
}
0 commit comments