Skip to content

Commit 97165fa

Browse files
committed
update args
1 parent 5555630 commit 97165fa

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

fastdeploy/function/tile.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ namespace fastdeploy {
1919
namespace function {
2020

2121
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,
2324
FDTensor* out) {
2425
auto x_shape = x.Shape();
26+
auto repeat_times = origin_repeat_times;
2527
for (size_t i = 0; i < repeat_times.size(); ++i) {
2628
FDASSERT(repeat_times[i] > 0,
2729
"All elements of the input 'repeat_times' "
@@ -66,7 +68,7 @@ void TileFunctor(const FDTensor& x, std::vector<int64_t> repeat_times,
6668
}
6769

6870
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,
7072
FDTensor* out) {
7173
auto rank = x.Shape().size();
7274
auto repeat_times_size = repeat_times.size();
@@ -96,7 +98,8 @@ void TileKernel(const FDTensor& x, std::vector<int64_t> repeat_times,
9698
}
9799
}
98100

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) {
100103
FD_VISIT_ALL_TYPES(x.dtype, "TileKernel",
101104
([&] { TileKernel<data_t>(x, repeat_times, out); }));
102105
}

fastdeploy/function/tile.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ namespace function {
2828
@param repeat_times The lower bound
2929
@param out The output tensor which stores the result.
3030
*/
31-
FASTDEPLOY_DECL void Tile(const FDTensor& x, std::vector<int64_t> repeat_times,
31+
FASTDEPLOY_DECL void Tile(const FDTensor& x,
32+
const std::vector<int64_t>& repeat_times,
3233
FDTensor* out);
3334

3435
} // namespace function

0 commit comments

Comments
 (0)