17 #include "fastdeploy/core/fd_scalar.h" 18 #include "fastdeploy/core/fd_tensor.h" 29 FASTDEPLOY_DECL
void Add(
const FDTensor& x,
const FDTensor& y, FDTensor* out);
36 FASTDEPLOY_DECL
void Subtract(
const FDTensor& x,
const FDTensor& y,
44 FASTDEPLOY_DECL
void Multiply(
const FDTensor& x,
const FDTensor& y,
52 FASTDEPLOY_DECL
void Divide(
const FDTensor& x,
const FDTensor& y,
60 FASTDEPLOY_DECL
void Maximum(
const FDTensor& x,
const FDTensor& y,
65 FASTDEPLOY_DECL FDTensor operator+(
const FDTensor& x,
const FDTensor& y);
67 template <
typename T> FDTensor operator+(
const FDTensor& x, T y) {
68 return x + FDTensor(Scalar(y));
71 template <
typename T> FDTensor operator+(T x,
const FDTensor& y) {
72 return FDTensor(Scalar(x)) + y;
75 FASTDEPLOY_DECL FDTensor operator-(
const FDTensor& x,
const FDTensor& y);
77 template <
typename T> FDTensor operator-(
const FDTensor& x, T y) {
78 return x - FDTensor(Scalar(y));
81 template <
typename T> FDTensor operator-(T x,
const FDTensor& y) {
82 return FDTensor(Scalar(x)) - y;
85 FASTDEPLOY_DECL FDTensor operator*(
const FDTensor& x,
const FDTensor& y);
87 template <
typename T> FDTensor operator*(
const FDTensor& x, T y) {
88 return x * FDTensor(Scalar(y));
91 template <
typename T> FDTensor operator*(T x,
const FDTensor& y) {
92 return FDTensor(Scalar(x)) * y;
95 FASTDEPLOY_DECL FDTensor operator/(
const FDTensor& x,
const FDTensor& y);
97 template <
typename T> FDTensor operator/(
const FDTensor& x, T y) {
98 return x / FDTensor(Scalar(y));
101 template <
typename T> FDTensor operator/(T x,
const FDTensor& y) {
102 return FDTensor(Scalar(x)) / y;
void Add(const FDTensor &x, const FDTensor &y, FDTensor *out)
Definition: elementwise.cc:30
void Divide(const FDTensor &x, const FDTensor &y, FDTensor *out)
Definition: elementwise.cc:45
void Maximum(const FDTensor &x, const FDTensor &y, FDTensor *out)
Definition: elementwise.cc:58
void Multiply(const FDTensor &x, const FDTensor &y, FDTensor *out)
Definition: elementwise.cc:40
void Subtract(const FDTensor &x, const FDTensor &y, FDTensor *out)
Definition: elementwise.cc:35
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16