提交 2513aa4c 编写于 作者: W wangliu

Merge remote-tracking branch 'upstream/develop' into develop

# Conflicts:
#	CMakeLists.txt
#	src/framework/dim.h
#	src/framework/program/program-optimize/node.h
上级 92c7ea22
...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "common/log.h"
#include "common/enforce.h" #include "common/enforce.h"
#include "common/log.h"
#pragma once #pragma once
...@@ -56,7 +56,6 @@ class RawData { ...@@ -56,7 +56,6 @@ class RawData {
char data[size]; char data[size];
RawData() {} RawData() {}
RawData(const RawData &raw_data) { strcpy(data, raw_data.data); } RawData(const RawData &raw_data) { strcpy(data, raw_data.data); }
}; };
template <typename... Ts> template <typename... Ts>
......
...@@ -128,7 +128,6 @@ class Attribute { ...@@ -128,7 +128,6 @@ class Attribute {
return vistor(attr.variant_.Get<int64_t>()); return vistor(attr.variant_.Get<int64_t>());
} else { } else {
PADDLE_MOBILE_THROW_EXCEPTION("type not support"); PADDLE_MOBILE_THROW_EXCEPTION("type not support");
} }
} }
......
...@@ -151,7 +151,7 @@ DDim DDim::operator+(DDim d) const { ...@@ -151,7 +151,7 @@ DDim DDim::operator+(DDim d) const {
std::vector<int64_t> v3; std::vector<int64_t> v3;
PADDLE_MOBILE_ENFORCE(v1.size() == v2.size(),"v1.size() != v2.size()"); PADDLE_MOBILE_ENFORCE(v1.size() == v2.size(), "v1.size() != v2.size()");
for (unsigned int i = 0; i < v1.size(); i++) { for (unsigned int i = 0; i < v1.size(); i++) {
v3.push_back(v1[i] + v2[i]); v3.push_back(v1[i] + v2[i]);
...@@ -277,30 +277,30 @@ int arity(const DDim &d) { ...@@ -277,30 +277,30 @@ int arity(const DDim &d) {
ArityVisitor arityVisitor = ArityVisitor(); ArityVisitor arityVisitor = ArityVisitor();
return DDim::ApplyVistor(arityVisitor, d); return DDim::ApplyVistor(arityVisitor, d);
} }
/// \cond HIDDEN /// \cond HIDDEN
/// \endcond /// \endcond
// struct OSVistor : Vistor<std::ostream &> {
// OSVistor(std::ostream &os) : os_(os) {}
//
// template <int D>
// std::ostream &operator()(Dim<D> dim) const {
// return os_ << dim;
// }
//
// private:
// std::ostream &os_;
//};
//struct OSVistor : Vistor<std::ostream &> { // std::ostream &operator<<(std::ostream &os, const DDim &ddim) {
// OSVistor(std::ostream &os) : os_(os) {} // auto vistor = OSVistor(os);
// // DDim::ApplyVistor(vistor, ddim);
// template <int D> // return os;
// std::ostream &operator()(Dim<D> dim) const { //}
// return os_ << dim;
// }
//
// private:
// std::ostream &os_;
//};
//std::ostream &operator<<(std::ostream &os, const DDim &ddim) {
// auto vistor = OSVistor(os);
// DDim::ApplyVistor(vistor, ddim);
// return os;
//}
#ifdef PADDLE_MOBILE_DEBUG #ifdef PADDLE_MOBILE_DEBUG
inline Print &operator<<(Print &printer, const DDim &ddim) { inline Print &operator<<(Print &printer, const DDim &ddim) {
for (int j = 0; j < ddim.size(); ++j) { for (int j = 0; j < ddim.size(); ++j) {
printer << ddim[j] << " "; printer << ddim[j] << " ";
} }
......
...@@ -16,9 +16,9 @@ limitations under the License. */ ...@@ -16,9 +16,9 @@ limitations under the License. */
#include <initializer_list> #include <initializer_list>
#include <vector> #include <vector>
#include "common/enforce.h"
#include "common/variant.h" #include "common/variant.h"
#include "dim.h" #include "dim.h"
#include "common/enforce.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
...@@ -57,7 +57,7 @@ struct DDim { ...@@ -57,7 +57,7 @@ struct DDim {
} else if (d.var.TypeId() == typeid(Dim<9>).hash_code()) { } else if (d.var.TypeId() == typeid(Dim<9>).hash_code()) {
return vistor(d.var.Get<Dim<9>>()); return vistor(d.var.Get<Dim<9>>());
} else { } else {
DLOG <<" dim not support"; DLOG << " dim not support";
} }
} }
......
...@@ -129,15 +129,12 @@ int64_t &indexer(Dim<D> &dim, int idx) { ...@@ -129,15 +129,12 @@ int64_t &indexer(Dim<D> &dim, int idx) {
template <> template <>
int64_t &indexer<0>(Dim<0> &dim, int idx) { int64_t &indexer<0>(Dim<0> &dim, int idx) {
PADDLE_MOBILE_THROW_EXCEPTION("Invalid index") PADDLE_MOBILE_THROW_EXCEPTION("Invalid index")
} }
template <int D> template <int D>
int64_t indexer(const Dim<D> &dim, int idx) { int64_t indexer(const Dim<D> &dim, int idx) {
if (idx < 0) { if (idx < 0) {
PADDLE_MOBILE_THROW_EXCEPTION("Tried to access a negative dimension") PADDLE_MOBILE_THROW_EXCEPTION("Tried to access a negative dimension")
} }
if (idx == 0) { if (idx == 0) {
return dim.head; return dim.head;
...@@ -148,7 +145,6 @@ int64_t indexer(const Dim<D> &dim, int idx) { ...@@ -148,7 +145,6 @@ int64_t indexer(const Dim<D> &dim, int idx) {
template <> template <>
int64_t indexer<0>(const Dim<0> &dim, int idx) { int64_t indexer<0>(const Dim<0> &dim, int idx) {
PADDLE_MOBILE_THROW_EXCEPTION("Invalid index") PADDLE_MOBILE_THROW_EXCEPTION("Invalid index")
} }
} // namespace } // namespace
...@@ -331,7 +327,7 @@ Dim<sizeof...(Args)> make_dim(Args... idxes) { ...@@ -331,7 +327,7 @@ Dim<sizeof...(Args)> make_dim(Args... idxes) {
// Allows us to output a Dim // Allows us to output a Dim
// XXX For some reason, overloading fails to resolve this correctly // XXX For some reason, overloading fails to resolve this correctly
//template <int i> // template <int i>
/*typename std::enable_if<(i > 1), std::ostream &>::type operator<<( /*typename std::enable_if<(i > 1), std::ostream &>::type operator<<(
std::ostream &os, const Dim<i> &d) { std::ostream &os, const Dim<i> &d) {
os << d.head << ", " << d.tail;l os << d.head << ", " << d.tail;l
...@@ -351,7 +347,5 @@ inline std::ostream &operator<<(std::ostream &os, const Dim<0> &d) { ...@@ -351,7 +347,5 @@ inline std::ostream &operator<<(std::ostream &os, const Dim<0> &d) {
return os; return os;
}*/ }*/
} // namespace framework } // namespace framework
} // namespace paddle_mobile } // namespace paddle_mobile
...@@ -17,7 +17,7 @@ limitations under the License. */ ...@@ -17,7 +17,7 @@ limitations under the License. */
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
//std::ostream &operator<<(std::ostream &os, const LoD &lod) { // std::ostream &operator<<(std::ostream &os, const LoD &lod) {
// os << "{"; // os << "{";
// for (auto &v : lod) { // for (auto &v : lod) {
// os << "{"; // os << "{";
...@@ -37,7 +37,7 @@ namespace framework { ...@@ -37,7 +37,7 @@ namespace framework {
// return os; // return os;
//} //}
// //
//std::ostream &operator<<(std::ostream &os, const LoDTensor &t) { // std::ostream &operator<<(std::ostream &os, const LoDTensor &t) {
// PADDLE_MOBILE_ENFORCE(t.type().hash_code() == typeid(float).hash_code(), // PADDLE_MOBILE_ENFORCE(t.type().hash_code() == typeid(float).hash_code(),
// "t.type() is not float"); // "t.type() is not float");
// os << "dim: " << t.dims() << "\n"; // os << "dim: " << t.dims() << "\n";
...@@ -51,7 +51,7 @@ namespace framework { ...@@ -51,7 +51,7 @@ namespace framework {
// return os; // return os;
//} //}
//std::string LoDToString(const LoD &lod) { // std::string LoDToString(const LoD &lod) {
// std::ostringstream stream; // std::ostringstream stream;
// stream << lod; // stream << lod;
// return stream.str(); // return stream.str();
......
...@@ -17,7 +17,6 @@ limitations under the License. */ ...@@ -17,7 +17,6 @@ limitations under the License. */
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
#include "common/log.h" #include "common/log.h"
#include "framework/program/op_desc.h" #include "framework/program/op_desc.h"
...@@ -34,7 +33,6 @@ class Node { ...@@ -34,7 +33,6 @@ class Node {
: op_desc_(op_desc), type_(op_desc->Type()) {} : op_desc_(op_desc), type_(op_desc->Type()) {}
Node &operator>(std::shared_ptr<Node> node); Node &operator>(std::shared_ptr<Node> node);
bool operator==(const Node &in); bool operator==(const Node &in);
bool CanSplit(std::unordered_set<std::string> complex_compute_set);
#ifdef PADDLE_MOBILE_DEBUG #ifdef PADDLE_MOBILE_DEBUG
std::string ToString() const; std::string ToString() const;
......
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
// //
// Created by Wang,Liu(MMS) on 2018/6/6. // Created by Wang,Liu(MMS) on 2018/6/6.
// //
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册