move grad ops to seperate folders

pull/4175/head
yoni baehr 5 years ago
parent b7ebe2be4b
commit 43d7d3af55

@ -109,7 +109,7 @@ checkopts()
ENABLE_GPU="off"
# Process the options
while getopts 'drvj:c:t:hsb:a:g:p:ie:m:l:I:LRP:Q:D:zM:V:K:swB:En' opt
while getopts 'drvj:c:t:hsb:a:g:p:ie:m:l:I:LRP:Q:D:zM:V:K:swB:EnT:' opt
do
OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]')
case "${opt}" in
@ -282,6 +282,11 @@ checkopts()
ENABLE_IBVERBS="on"
echo "enable IBVERBS for parameter server"
;;
T)
check_on_off $OPTARG T
SUPPORT_TRAIN=$OPTARG
echo "support train on device "
;;
*)
echo "Unknown option ${opt}!"
usage

@ -23,6 +23,7 @@ endif()
if (SUPPORT_TRAIN)
set(ANF_SRC
${ANF_SRC}
# ${CCSRC_DIR}/common/trans.cc
# ${CCSRC_DIR}/utils/lite/base_ref_utils.cc
# ${CCSRC_DIR}/runtime/kernel/kernel_compiler/kernel_build_info.cc
@ -40,14 +41,17 @@ if (SUPPORT_TRAIN)
set(LITE_SRC
${LITE_SRC}
${ANF_SRC}
${PASS_SRC}
${CMAKE_CURRENT_SOURCE_DIR}/common/anf_importer/anf_importer.cc
${CMAKE_CURRENT_SOURCE_DIR}/common/anf_importer/import_from_meta_graph.cc
${CMAKE_CURRENT_SOURCE_DIR}/ir/primitive_value.cc
${CMAKE_CURRENT_SOURCE_DIR}/train/lite_kernel_runtime.cc
${CMAKE_CURRENT_SOURCE_DIR}/train/train_session.cc
${CMAKE_CURRENT_SOURCE_DIR}/train/model_impl.cc
# ${PASS_SRC}
# ${CMAKE_CURRENT_SOURCE_DIR}/common/anf_importer/anf_importer.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/common/anf_importer/import_from_meta_graph.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/ir/primitive_value.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/train/lite_kernel_runtime.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/train/train_session.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/train/model_impl.cc
${CMAKE_CURRENT_SOURCE_DIR}/lite_session.cc # temporary
${CMAKE_CURRENT_SOURCE_DIR}/model_impl.cc # temporary
)
else ()
set(LITE_SRC
${LITE_SRC}

@ -27,96 +27,143 @@
namespace mindspore::lite {
void AnfImporterFromMetaGraph::ConverterConstTensor() {
MS_EXCEPTION_IF_NULL(model);
auto *meta_graph = model->GetMetaGraph();
MS_EXCEPTION_IF_NULL(model_);
auto *meta_graph = model_->GetMetaGraph();
MS_EXCEPTION_IF_NULL(meta_graph);
for (size_t i = 0; i < meta_graph->allTensors()->size(); i++) {
num_of_tensors_ = meta_graph->allTensors()->size();
for (size_t i = 0; i < num_of_tensors_; i++) {
auto *tensor = meta_graph->allTensors()->GetAs<schema::Tensor>(i);
MS_EXCEPTION_IF_NULL(tensor);
if (tensor->nodeType() != schema::NodeType_ValueNode) {
if ((tensor->nodeType() != schema::NodeType_ValueNode) && (tensor->nodeType() != schema::NodeType_Parameter)) {
continue;
}
MS_ASSERT(tensor->dims() != nullptr);
auto parameter = model->add_parameter();
auto parameter = model_->add_parameter();
std::vector<int> shape;
for (size_t j = 0; j < tensor->dims()->size(); ++j) {
shape.push_back(tensor->dims()->data()[j]);
}
auto type_id = static_cast<TypeId>(tensor->dataType());
auto type_id = static_cast<TypeId>(tensor->dataType()); // todo: check error
auto type_ptr = TypeIdToType(type_id);
auto abstract_tensor = std::make_shared<abstract::AbstractTensor>(type_ptr, shape);
parameter->set_abstract(abstract_tensor);
auto abstractBase = std::make_shared<abstract::AbstractTensor>(type_ptr, shape);
// XXX TODO copy format
parameter->set_abstract(abstractBase);
parameter->set_name(std::string("Parameter"));
ParamValueLitePtr param_value = std::make_shared<ParamValueLite>();
MS_EXCEPTION_IF_NULL(param_value);
param_value->set_tensor_shape(shape);
param_value->set_tensor_type(type_id);
if (tensor->data() != nullptr) {
auto size = tensor->data()->size();
char *tensor_data = new char[size]();
std::memcpy(tensor_data, tensor->data()->data(), size);
MS_EXCEPTION_IF_NULL(tensor_data);
param_value->set_tensor_addr(tensor_data);
param_value->set_tensor_size(size);
if (tensor->nodeType() == schema::NodeType_ValueNode) {
ParamValueLitePtr param_value = std::make_shared<ParamValueLite>();
MS_EXCEPTION_IF_NULL(param_value);
param_value->set_tensor_shape(shape);
param_value->set_tensor_type(type_id);
if (tensor->data() != nullptr) {
auto size = tensor->data()->size();
char *tensor_data = new char[size]();
std::memcpy(tensor_data, tensor->data()->data(), size);
MS_EXCEPTION_IF_NULL(tensor_data);
param_value->set_tensor_addr(tensor_data);
param_value->set_tensor_size(size);
}
parameter->set_default_param(param_value);
}
parameter->set_default_param(param_value);
AddNode(i, parameter);
model_->AddAnfNode(i, parameter);
}
}
int AnfImporterFromMetaGraph::ConverterCNode() {
MS_EXCEPTION_IF_NULL(model);
auto *meta_graph = model->GetMetaGraph();
MS_EXCEPTION_IF_NULL(model_);
auto *meta_graph = model_->GetMetaGraph();
MS_EXCEPTION_IF_NULL(meta_graph);
auto cNodes = meta_graph->nodes();
for (size_t i = 0; i < cNodes->size(); i++) {
auto cNode = cNodes->GetAs<schema::CNode>(i);
MS_EXCEPTION_IF_NULL(cNode);
auto tensor_id = cNode->outputIndex()->data()[0];
if (GetNode(tensor_id)) {
continue;
}
auto prim = std::make_shared<PrimitiveValue>(model->GetOp(cNode->name()->str()));
// Crate CNode -- Order of inputs is as follows
// First input should be the Primitive
// Then we have CNodes that contribute to this CNode
// Finally we Have the parameters
// first itteration -- create CNode with primitive, create originator map
for (size_t i = 0; i < meta_graph->nodes()->size(); i++) {
auto cNode = meta_graph->nodes()->GetAs<schema::CNode>(i);
MS_EXCEPTION_IF_NULL(cNode);
auto prim = std::make_shared<PrimitiveValue>(model_->GetOp(cNode->name()->str()));
if (prim == nullptr) {
MS_LOG(ERROR) << "th tensorDef in subGraphDef is nullptr";
return RET_ERROR;
}
auto value_node = NewValueNode(prim);
AddNode(tensor_id, value_node);
// auto prim_name = std::string("PrimitivePy: ") + std::string(cNode->name()->c_str());
// value_node->set_fullname_with_scope(prim_name);
std::vector<AnfNodePtr> op_inputs = {value_node};
auto cnode = model_->NewCNode(op_inputs);
auto node_name = std::string(cNode->name()->c_str()) + std::to_string(i);
cnode->set_fullname_with_scope(node_name);
AddNode(num_of_tensors_ + i, cnode);
for (size_t j = 0; j < cNode->outputIndex()->size(); j++) {
int tensor_id = cNode->outputIndex()->data()[j];
originator_[tensor_id] = cnode;
}
}
// second itteration -- fill in input CNodes and Parameters
// populate map
for (size_t i = 0; i < meta_graph->nodes()->size(); i++) {
std::vector<int> input;
std::vector<int> output;
int tensor_id;
auto cNode = meta_graph->nodes()->GetAs<schema::CNode>(i);
MS_EXCEPTION_IF_NULL(cNode);
auto cnode = std::dynamic_pointer_cast<CNode>(GetNode(num_of_tensors_ + i));
for (size_t j = 0; j < cNode->outputIndex()->size(); j++) {
tensor_id = cNode->outputIndex()->data()[j];
output.push_back(tensor_id);
}
MS_EXCEPTION_IF_NULL(cNode->inputIndex());
for (size_t j = 0; j < cNode->inputIndex()->size(); j++) {
auto node = GetNode(*(cNode->inputIndex()->GetAs<uint32_t>(j)));
if (nullptr == node) {
MS_LOG(ERROR) << "Can't find input node.";
return RET_ERROR;
tensor_id = cNode->inputIndex()->data()[j];
input.push_back(tensor_id);
auto *tensor = meta_graph->allTensors()->GetAs<schema::Tensor>(tensor_id);
MS_EXCEPTION_IF_NULL(tensor);
if ((tensor->nodeType() == schema::NodeType_Parameter) && (originator_[tensor_id] != nullptr)) {
cnode->add_input(originator_[tensor_id]);
}
// todo: CheckInputNodeType, the first node should be op;
op_inputs.push_back(node);
}
auto cnode = model->NewCNode(op_inputs);
auto node_name = std::string(cNode->name()->c_str());
cnode->set_fullname_with_scope(node_name);
AddNode(tensor_id, cnode);
// finally add all the Parameters (which are ValueNodes)
for (size_t j = 0; j < cNode->inputIndex()->size(); j++) {
tensor_id = cNode->inputIndex()->data()[j];
auto *tensor = meta_graph->allTensors()->GetAs<schema::Tensor>(tensor_id);
MS_EXCEPTION_IF_NULL(tensor);
if ((tensor->nodeType() == schema::NodeType_ValueNode) && (GetNode(tensor_id) != nullptr)) {
cnode->add_input(GetNode(tensor_id));
}
}
model_->AddCNodeInputOutput(cnode->fullname_with_scope(), input, output);
}
return RET_OK;
}
void AnfImporterFromMetaGraph::AddReturnCNode() {
MS_EXCEPTION_IF_NULL(model);
auto *meta_graph = model->GetMetaGraph();
MS_EXCEPTION_IF_NULL(model_);
auto *meta_graph = model_->GetMetaGraph();
MS_EXCEPTION_IF_NULL(meta_graph);
std::vector<int> input;
std::vector<int> output;
std::vector<AnfNodePtr> op_inputs;
auto value_node = NewValueNode(prim::kPrimReturn);
// value_node->set_fullname_with_scope("Primitive");
op_inputs.push_back(value_node);
auto tensor_id = meta_graph->outputIndex()->data()[0];
op_inputs.push_back(GetNode(tensor_id));
auto cnode = model->NewCNode(op_inputs);
for (int i = 0; i < meta_graph->outputIndex()->size(); i++) {
auto prev_cnode = originator_[meta_graph->outputIndex()->data()[i]];
if (prev_cnode != nullptr) op_inputs.push_back(prev_cnode);
input.push_back(meta_graph->outputIndex()->data()[i]);
}
auto cnode = model_->NewCNode(op_inputs);
cnode->set_fullname_with_scope("return");
model->set_return(cnode);
model_->set_return(cnode);
model_->AddCNodeInputOutput(cnode->fullname_with_scope(), input, output);
}
FuncGraphPtr AnfImporterFromMetaGraph::GetResult() { return this->model; }
FuncGraphPtr AnfImporterFromMetaGraph::GetResult() { return this->model_; }
} // namespace mindspore::lite

@ -18,6 +18,7 @@
#define MINDSPORE_LITE_SRC_ANF_IMPORTER_IMPORTER_FROM_META_GRAPH_H_
#include <memory>
#include <map>
#include "src/train/model_impl.h"
#include "schema/model_generated.h"
#include "src/common/anf_importer/anf_importer.h"
@ -25,7 +26,7 @@
namespace mindspore::lite {
class AnfImporterFromMetaGraph : public AnfImporter {
public:
explicit AnfImporterFromMetaGraph(std::shared_ptr<ModelImpl> model) : model(model) {}
explicit AnfImporterFromMetaGraph(std::shared_ptr<ModelImpl> model) : model_(model) {}
~AnfImporterFromMetaGraph() override = default;
@ -39,9 +40,10 @@ class AnfImporterFromMetaGraph : public AnfImporter {
void AddReturnCNode() override;
private:
std::shared_ptr<ModelImpl> model = nullptr;
std::shared_ptr<ModelImpl> model_ = nullptr;
std::map<int, AnfNodePtr> originator_;
int num_of_tensors_ = 0;
};
} // namespace mindspore::lite
#endif // MINDSPORE_LITE_SRC_ANF_IMPORTER_IMPORTER_FROM_META_GRAPH_H_

@ -60,7 +60,7 @@ class LiteKernel {
explicit LiteKernel(OpParameter *parameter, const std::vector<lite::tensor::Tensor *> &inputs,
const std::vector<lite::tensor::Tensor *> &outputs, const lite::Context *ctx,
const lite::Primitive *primitive)
: opParameter(parameter), inputs_(inputs), outputs_(outputs), train_mode(false), primitive_(primitive),
: opParameter(parameter), inputs_(inputs), outputs_(outputs), primitive_(primitive),
context_(ctx) {
this->in_kernel_.clear();
this->out_kernel_.clear();
@ -136,7 +136,7 @@ class LiteKernel {
std::vector<lite::tensor::Tensor *> outputs_;
std::vector<LiteKernel *> in_kernel_;
std::vector<LiteKernel *> out_kernel_;
bool train_mode;
bool train_mode = false;
bool need_reinit = false;
};

@ -14,11 +14,11 @@
* limitations under the License.
*/
#ifdef SUPPORT_TRAIN
#include "src/train/model_impl.h"
#else
// #ifdef SUPPORT_TRAIN
// #include "src/train/model_impl.h"
// #else
#include "src/model_impl.h"
#endif
// #endif
#include "include/model.h"
#include "utils/log_adapter.h"

@ -10,6 +10,13 @@ file(GLOB KERNEL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/int8/*.cc
)
if (SUPPORT_TRAIN)
file (GLOB TRAIN_KERNEL_SRC
${CMAKE_CURRENT_SOURCE_DIR}/fp32_grad/*.cc
${CMAKE_CURRENT_SOURCE_DIR}/nnacl/fp32_grad/*.cc
)
endif()
if (PLATFORM_ARM64)
# assembly
file(GLOB ASSEMBLY_SRC nnacl/assembly/arm64/*.s
@ -27,5 +34,5 @@ if (PLATFORM_ARM32)
set(KERNEL_SRC ${KERNEL_SRC} ${ASSEMBLY_SRC})
endif()
add_library(cpu_kernel_mid_ OBJECT ${KERNEL_SRC})
add_library(cpu_kernel_mid_ OBJECT ${KERNEL_SRC} ${TRAIN_KERNEL_SRC})
add_subdirectory(nnacl)

@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "src/runtime/kernel/arm/fp32/activation_grad.h"
#include "src/runtime/kernel/arm/fp32_grad/activation_grad.h"
#include "schema/model_generated.h"
#include "src/kernel_registry.h"
#include "src/runtime/runtime_api.h"
@ -102,6 +102,8 @@ kernel::LiteKernel *CpuActivationGradFp32KernelCreator(const std::vector<lite::t
if (ret != RET_OK) {
MS_LOG(ERROR) << "InferShape kernel failed, name: " << opParameter->name_ << ", type: "
<< schema::EnumNamePrimitiveType(static_cast<schema::PrimitiveType>(opParameter->type_));
delete kernel;
return nullptr;
}
return kernel;
}

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ACTIVATION_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ACTIVATION_GRAD_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_ACTIVATION_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_ACTIVATION_GRAD_H_
#include <vector>
#include "src/lite_kernel.h"
@ -48,4 +48,4 @@ class ActivationGradCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ACTIVATION_GRAD_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_ACTIVATION_GRAD_H_

@ -16,9 +16,9 @@
#include "schema/model_generated.h"
#include "src/kernel_registry.h"
#include "src/runtime/kernel/arm/nnacl/fp32/reduce_grad.h"
#include "src/runtime/kernel/arm/fp32/arithmetic_grad.h"
#include "src/runtime/kernel/arm/nnacl/fp32/arithmetic_grad.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/reduce_grad.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/arithmetic_grad.h"
#include "src/runtime/kernel/arm/fp32_grad/arithmetic_grad.h"
#include "include/errorcode.h"
using mindspore::kernel::KERNEL_ARCH::kCPU;

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ARITHMETIC_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ARITHMETIC_GRAD_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_ARITHMETIC_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_ARITHMETIC_GRAD_H_
#include <vector>
#include "src/lite_kernel.h"
@ -88,4 +88,4 @@ class ArithmeticGradCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_ARITHMETIC_GRAD_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_ARITHMETIC_GRAD_H_

@ -15,7 +15,7 @@
*/
#include <vector>
#include "src/runtime/kernel/arm/fp32/bias_grad.h"
#include "src/runtime/kernel/arm/fp32_grad/bias_grad.h"
#include "schema/model_generated.h"
#include "src/kernel_registry.h"
#include "include/errorcode.h"

@ -18,8 +18,8 @@
#include <vector>
#include "schema/model_generated.h"
#include "src/kernel_factory.h"
#include "src/runtime/kernel/arm/fp32/bngrad_input.h"
#include "src/runtime//kernel/arm/nnacl/batch_norm.h"
#include "src/runtime/kernel/arm/fp32_grad/bn_grad.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/batch_norm.h"
#include "include/errorcode.h"
using mindspore::kernel::KERNEL_ARCH::kCPU;
@ -54,10 +54,6 @@ int BNGradInputCPUKernel::Init() {
int BNGradInputCPUKernel::ReSize() { return RET_OK; }
/*
according to https://wiseodd.github.io/techblog/2016/07/04/batchnorm
*/
int BNGradInputCPUKernel::Run() {
// std::cout << "run succ" << std::endl;
auto *input_x = inputs_.at(0);
@ -107,6 +103,8 @@ kernel::LiteKernel *CpuBNGradInputFp32KernelCreator(const std::vector<lite::tens
if (RET_OK != ret) {
MS_LOG(ERROR) << "Init kernel failed, name: " << opParameter->name_ << ", type: "
<< schema::EnumNamePrimitiveType(static_cast<schema::PrimitiveType>(opParameter->type_));
delete kernel;
return nullptr;
}
return kernel;
}

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_BNGRAD_INPUT_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_BNGRAD_INPUT_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_BNGRAD_INPUT_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_BNGRAD_INPUT_H_
#include <vector>
#include "src/lite_kernel.h"
@ -39,4 +39,4 @@ class BNGradInputCPUKernel : public LiteKernel {
int workspace_size;
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_BNGRAD_INPUT_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_BNGRAD_INPUT_H_

@ -14,11 +14,11 @@
* limitations under the License.
*/
#include "src/runtime/kernel/arm/fp32/convolution_grad_filter.h"
#include "src/runtime/kernel/arm/fp32_grad/convolution_grad_filter.h"
#include "src/kernel_registry.h"
#include "src/runtime/kernel/arm/nnacl/pack.h"
#include "src/runtime/kernel/arm/nnacl/pack_ext.h"
#include "src/runtime/kernel/arm/nnacl/fp32/gemm.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/gemm.h"
#include "include/errorcode.h"
using mindspore::kernel::KERNEL_ARCH::kCPU;

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_CONVOLUTION_GRAD_FILTER_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_CONVOLUTION_GRAD_FILTER_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_CONVOLUTION_GRAD_FILTER_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_CONVOLUTION_GRAD_FILTER_H_
#include <vector>
#include "src/lite_kernel.h"
@ -39,4 +39,4 @@ class ConvolutionGradFilterCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_CONVOLUTION_GRAD_FILTER_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_CONVOLUTION_GRAD_FILTER_H_

@ -14,11 +14,11 @@
* limitations under the License.
*/
#include "src/runtime/kernel/arm/fp32/convolution_grad_input.h"
#include "src/runtime/kernel/arm/fp32_grad/convolution_grad_input.h"
#include "src/kernel_registry.h"
#include "src/runtime/kernel/arm/nnacl/pack.h"
#include "src/runtime/kernel/arm/nnacl/pack_ext.h"
#include "src/runtime/kernel/arm/nnacl/fp32/gemm.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/pack_ext.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/gemm.h"
#include "include/errorcode.h"
using mindspore::kernel::KERNEL_ARCH::kCPU;

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_CONVOLUTION_GRAD_INPUT_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_CONVOLUTION_GRAD_INPUT_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_CONVOLUTION_GRAD_INPUT_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_CONVOLUTION_GRAD_INPUT_H_
#include <vector>
#include "src/lite_kernel.h"
@ -39,4 +39,4 @@ class ConvolutionGradInputCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_CONVOLUTION_GRAD_INPUT_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_CONVOLUTION_GRAD_INPUT_H

@ -17,7 +17,7 @@
#include "schema/model_generated.h"
#include "src/kernel_registry.h"
#include "src/runtime/kernel/arm/fp32/opt_momentum.h"
#include "src/runtime/kernel/arm/fp32_grad/opt_momentum.h"
#include "include/errorcode.h"
using mindspore::kernel::KERNEL_ARCH::kCPU;

@ -14,11 +14,11 @@
* limitations under the License.
*/
#include "src/runtime/kernel/arm/fp32/pooling_grad.h"
#include "src/runtime/kernel/arm/fp32_grad/pooling_grad.h"
#include "schema/model_generated.h"
#include "src/kernel_registry.h"
#include "src/runtime/kernel/arm/nnacl/fp32/pooling.h"
#include "src/runtime/kernel/arm/nnacl/fp32/pooling_grad.h"
#include "src/runtime/kernel/arm/nnacl/fp32_grad/pooling_grad.h"
#include "include/errorcode.h"
using mindspore::kernel::KERNEL_ARCH::kCPU;

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_POOLING_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_POOLING_GRAD_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_POOLING_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_POOLING_GRAD_H_
#include <vector>
#include "src/lite_kernel.h"
@ -48,4 +48,4 @@ class PoolingGradCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_POOLING_GRAD_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_POOLING_GRAD_H_

@ -14,7 +14,7 @@
* limitations under the License.
*/
#include "src/runtime/kernel/arm/fp32/power_grad.h"
#include "src/runtime/kernel/arm/fp32_grad/power_grad.h"
#include "schema/model_generated.h"
#include "src/kernel_registry.h"
#include "include/errorcode.h"

@ -14,8 +14,8 @@
* limitations under the License.
*/
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_POWER_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_POWER_GRAD_H_
#ifndef MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_POWER_GRAD_H_
#define MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_POWER_GRAD_H_
#include <vector>
#include "src/lite_kernel.h"
@ -47,4 +47,4 @@ class PowerGradCPUKernel : public LiteKernel {
};
} // namespace mindspore::kernel
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_POWER_GRAD_H_
#endif // MINDSPORE_LITE_SRC_RUNTIME_KERNEL_ARM_FP32_GRAD_POWER_GRAD_H_

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save