提交 06a6f6a9 编写于 作者: H hjchen2

Fix fpga compile

上级 ca13e989
......@@ -399,8 +399,7 @@ void Executor<Device, T>::FeedData(const Tensor &t) {
template <typename Device, typename T>
std::shared_ptr<Tensor> Executor<Device, T>::FetchResult(int id) {
std::shared_ptr<BlockDesc> to_predict_block = program_desc_->Block(0);
auto &ops = ops_of_block_[*to_predict_block.get()];
auto &ops = ops_of_block_[0];
PADDLE_MOBILE_ENFORCE(id < (int)ops.size(), "Index out of range");
auto op = id < 0 ? ops[ops.size() - 1] : ops[id];
......@@ -414,8 +413,7 @@ std::shared_ptr<Tensor> Executor<Device, T>::FetchResult(int id) {
template <typename Device, typename T>
void Executor<Device, T>::Predict_From_To(int start, int end) {
std::shared_ptr<BlockDesc> to_predict_block = program_desc_->Block(0);
auto &ops = ops_of_block_[*to_predict_block.get()];
auto &ops = ops_of_block_[0];
end = end < 0 ? static_cast<int>(ops.size()) : end;
PADDLE_MOBILE_ENFORCE(start >= 0 && start < end && end <= ops.size(),
"start or end parameter is wrong");
......
......@@ -15,6 +15,7 @@ limitations under the License. */
#ifdef FUSION_CONVBN_OP
#include "operators/kernel/conv_bn_kernel.h"
#include <cmath>
namespace paddle_mobile {
namespace operators {
......
......@@ -15,6 +15,7 @@ limitations under the License. */
#ifdef FUSION_CONVBNRELU_OP
#include "operators/kernel/conv_bn_relu_kernel.h"
#include <cmath>
namespace paddle_mobile {
namespace operators {
......
......@@ -97,7 +97,7 @@ void SoftmaxFuntor<CPU, float>::operator()(const framework::Tensor *X,
}
#endif // __ARM_NEON__
for (int i = 0; i < remain; ++i) {
output[i] = std::expf(input[i] - max);
output[i] = expf(input[i] - max);
}
// sum(exp(x - max))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册