tile.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #include "ultra_infer/core/fd_tensor.h"
  16. namespace ultra_infer {
  17. namespace function {
  18. /** Construct a new Tensor by repeating x the number of times given by
  19. ** repeat_times. After tiling, the value of the i’th dimension of the
  20. ** output is equal to x.shape[i]*repeat_times[i]. Both the number of
  21. ** dimensions of x and the number of elements in repeat_times should
  22. ** be less than or equal to 6.Support all data types.
  23. @param x The input tensor.
  24. @param repeat_times The lower bound
  25. @param out The output tensor which stores the result.
  26. */
  27. ULTRAINFER_DECL void Tile(const FDTensor &x,
  28. const std::vector<int64_t> &repeat_times,
  29. FDTensor *out);
  30. } // namespace function
  31. } // namespace ultra_infer