mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-07 09:31:35 +08:00
[Functions] Add +-*/ operators and reshape for FDTensor (#655)
* Add +-*/ functions * Add same dims test case for operations * add broadcast 0 * Add broadcast dim2 testcase * Add broadcast dim3 and dim4 testcase * Add +-*/ operators * Add mixed operation * refresh code style * Add reshape op * update code style
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include "fastdeploy/utils/utils.h"
|
||||
#include <sstream>
|
||||
|
||||
namespace fastdeploy {
|
||||
|
||||
@@ -55,4 +56,14 @@ std::vector<int64_t> GetStride(const std::vector<int64_t>& dims) {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string Str(const std::vector<int64_t>& shape) {
|
||||
std::ostringstream oss;
|
||||
oss << "[ " << shape[0];
|
||||
for (int i = 1; i < shape.size(); ++i) {
|
||||
oss << " ," << shape[i];
|
||||
}
|
||||
oss << " ]";
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
} // namespace fastdeploy
|
||||
|
Reference in New Issue
Block a user