!14362 [MS][LITE][Develop]fix CodingStyle warnings

From: @lx0095
Reviewed-by: @hangangqiang
Signed-off-by: @hangangqiang
This commit is contained in:
mindspore-ci-bot 2021-04-01 11:34:52 +08:00 committed by Gitee
commit ab0e68c805
13 changed files with 25 additions and 14 deletions

View File

@ -16,7 +16,7 @@
#include "nnacl/fp32/prelu_fp32.h"
#ifdef ENABLE_ARM64
inline void PRelu4x16(const float *in, float *out, float *cur_slope, size_t step) {
static inline void PRelu4x16(const float *in, float *out, float *cur_slope, size_t step) {
asm volatile(
"mov x10, %[in]\n"
"mov x11, %[out]\n"

View File

@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "include/api/cell.h"
#include "include/api/lite_context.h"
#include "src/common/log_adapter.h"
namespace mindspore {
class GraphImpl {};
std::vector<Output> CellBase::operator()(const std::vector<Input> &inputs) const {
@ -92,5 +92,4 @@ InputAndOutput::InputAndOutput(const std::shared_ptr<CellBase> &cell, const std:
: index_(-1) {
MS_LOG(ERROR) << "Unsupported feature.";
}
} // namespace mindspore

View File

@ -19,7 +19,6 @@
#include "src/cxx_api/graph/graph_data.h"
namespace mindspore {
Graph::Graph(const std::shared_ptr<GraphData> &graph_data) : graph_data_(graph_data) {}
Graph::Graph(std::shared_ptr<GraphData> &&graph_data) : graph_data_(graph_data) {}

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_CXX_API_GRAPH_GRAPH_DATA_H
#define MINDSPORE_LITE_SRC_CXX_API_GRAPH_GRAPH_DATA_H
@ -39,4 +40,5 @@ class Graph::GraphData {
std::shared_ptr<lite::Model> lite_model_;
};
} // namespace mindspore
#endif // MINDSPORE_LITE_SRC_CXX_API_GRAPH_GRAPH_DATA_H

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "include/api/lite_context.h"
#include <string>
#include <memory>
@ -21,7 +22,6 @@
#include "src/common/log_adapter.h"
namespace mindspore {
constexpr char kVendorName[] = "vendor_name";
constexpr char kThreadNum[] = "thread_name";
constexpr char kAllocator[] = "allocator";
@ -299,5 +299,4 @@ int Context::GetNPUFrequency(const std::shared_ptr<Context> &context) {
}
return 3;
}
} // namespace mindspore

View File

@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "include/api/model.h"
#include "include/api/lite_context.h"
#include "src/cxx_api/model/model_impl.h"
#include "src/common/log_adapter.h"
namespace mindspore {
Status Model::Build() {
if (impl_ == nullptr) {
MS_LOG(ERROR) << "Model implement is null.";
@ -89,5 +89,4 @@ std::vector<MSTensor> Model::GetOutputs() {
}
return impl_->GetOutputs();
}
} // namespace mindspore

View File

@ -127,6 +127,9 @@ Status ModelImpl::Predict(const std::vector<MSTensor> &inputs, std::vector<MSTen
<< ".";
}
if (user_input.MutableData() == nullptr) {
for (size_t j = 0; j < old_data.size(); j++) {
input_tensors.at(j)->set_data(old_data.at(j));
}
MS_LOG(ERROR) << "Failed to get the data of input tensor.";
return kLiteInputTensorError;
}
@ -286,5 +289,4 @@ Status ModelImpl::Resize(const std::vector<MSTensor> &inputs, const std::vector<
auto ret = session_->Resize(inner_input, truncated_shape);
return static_cast<StatusCode>(ret);
}
} // namespace mindspore

View File

@ -13,8 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_CXX_API_MODEL_MODEL_IMPL_H
#define MINDSPORE_LITE_SRC_CXX_API_MODEL_MODEL_IMPL_H
#include <functional>
#include <map>
#include <string>

View File

@ -27,7 +27,6 @@
#include "src/common/log_adapter.h"
namespace mindspore {
Graph Serialization::LoadModel(const void *model_data, size_t data_size, ModelType model_type) {
if (model_type != kMindIR) {
MS_LOG(ERROR) << "Unsupported IR.";

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "src/cxx_api/tensor/tensor_impl.h"
#include <numeric>
#include <memory>
@ -36,5 +37,4 @@ MSTensor::Impl::Impl(const std::string &name, enum DataType type, const std::vec
lite_tensor_ = new (std::nothrow) lite::Tensor(name, static_cast<enum TypeId>(type), truncated_shape, data);
}
}
} // namespace mindspore

View File

@ -13,6 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_CXX_API_TENSOR_TENSOR_IMPL_H
#define MINDSPORE_LITE_SRC_CXX_API_TENSOR_TENSOR_IMPL_H
#include <cstddef>
#include <numeric>
#include <memory>
@ -142,5 +146,6 @@ class MSTensor::Impl {
bool need_copy_ = true;
bool from_session_ = false;
};
} // namespace mindspore
#endif // MINDSPORE_LITE_SRC_CXX_API_TENSOR_TENSOR_IMPL_H

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "include/api/types.h"
#include <string.h>
#include <limits.h>
@ -23,7 +24,6 @@
#include "src/common/log_adapter.h"
namespace mindspore {
class Buffer::Impl {
public:
Impl() : data_() { MS_LOG(ERROR) << "Unsupported feature."; }

View File

@ -13,6 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_CXX_API_UTILS_H
#define MINDSPORE_LITE_SRC_CXX_API_UTILS_H
#include <limits.h>
#include <vector>
#include "src/tensor.h"
@ -45,5 +49,6 @@ static std::vector<int32_t> TruncateShape(const std::vector<int64_t> &shape, enu
}
return truncated_shape;
}
} // namespace mindspore
#endif // MINDSPORE_LITE_SRC_CXX_API_UTILS_H