提交 179603ec 编写于 作者: S sunsuodong

fix compile warning

上级 c17ed236
......@@ -82,6 +82,8 @@ int Executor::TransformTensorLayout(tensor::Tensor *tensor, schema::Format dst_f
return TransformTensorLayoutUint8(tensor, dst_format, allocator);
case kNumberTypeFloat32:
return TransformTensorLayoutFp32(tensor, dst_format, allocator);
default:
return RET_ERROR;
}
return RET_OK;
}
......
......@@ -54,7 +54,7 @@ int ScatterND::InferShape(std::vector<tensor::Tensor *> inputs_, std::vector<ten
}
auto output = outputs_.front();
auto shape_data = reinterpret_cast<int *>(shape->Data());
std::vector<int> out_shape(shape_data, shape_data + sizeof(shape_data) / sizeof(shape_data[0]));
std::vector<int> out_shape(shape_data, shape_data + shape->DataSize());
output->set_shape(out_shape);
output->set_data_type(update->data_type());
output->SetFormat(update->GetFormat());
......
......@@ -45,7 +45,7 @@ int Shape::InferShape(std::vector<tensor::Tensor *> inputs_, std::vector<tensor:
MS_LOG(ERROR) << "Set shape fails.";
return RET_ERROR;
}
auto ret_dtype = out_tensor->set_data_type({in_tensor->data_type()});
auto ret_dtype = out_tensor->set_data_type(in_tensor->data_type());
if (ret_dtype != in_tensor->data_type()) {
MS_LOG(ERROR) << "Set datatype fails.";
return RET_ERROR;
......
......@@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_BACKEND_ARM_FP32_OPT_MOMENTUM_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPT_MOMENTUM_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_OPT_MOMENTUM_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_OPT_MOMENTUM_H_
#include <vector>
#include "src/lite_kernel.h"
......@@ -37,4 +37,4 @@ class OptMomentumCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_OPT_MOMENTUM_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_OPT_MOMENTUM_H_
......@@ -85,6 +85,7 @@ int SpaceToDepthCPUKernel::Run() {
MS_LOG(ERROR) << "SpaceToDepth error error_code[" << ret << "]";
return ret;
}
return RET_OK;
} else {
MS_LOG(ERROR) << "Only support NHWC now!";
return RET_ERROR;
......
......@@ -143,7 +143,7 @@ inline void CalculateActivationRangeQuantized(bool is_relu, bool is_relu6, int32
inline void Quantize(float *input_data, int length, float scale, int zero_point, int8_t *output_data) {
for (int i = 0; i < length; ++i) {
int r = (int)round(input_data[i] / scale + zero_point);
int8_t q = r > CHAR_MAX ? CHAR_MAX : r;
int8_t q = r > CHAR_MAX ? (int8_t)CHAR_MAX : (int8_t)r;
q = q < CHAR_MIN ? CHAR_MIN : q;
output_data[i] = q;
}
......
......@@ -28,7 +28,7 @@ class SpaceToBatchTestFp32 : public mindspore::Common {
SpaceToBatchTestFp32() {}
};
int InitSpaceToBatchParameter(SpaceToBatchParameter *param) {
void InitSpaceToBatchParameter(SpaceToBatchParameter *param) {
param->n_dims_ = 4;
param->n_space_dims_ = 2;
......@@ -56,7 +56,7 @@ int InitSpaceToBatchParameter(SpaceToBatchParameter *param) {
param->need_paddings_ = true;
}
int InitSpaceToBatchParameter2(SpaceToBatchParameter *param) {
void InitSpaceToBatchParameter2(SpaceToBatchParameter *param) {
param->block_sizes_[0] = 2;
param->block_sizes_[1] = 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册