void StageGenerator::visit(const model::operation::MaxPool2DNode &node)
{
- VERBOSE(MaxPool2D) << "generate CPU MaxPool2D" << std::endl;
-
const auto ofm_index{node.getOutputs().at(0)};
const auto ifm_index{node.getInputs().at(model::operation::MaxPool2DNode::Input::INPUT)};
param.activation = static_cast<FuseCode>(_ctx.at(activation_index).asScalar<int32_t>());
- VERBOSE(MaxPool2D) << "IFM_H: " << _ctx.at(ifm_index).shape().asFeature().H << std::endl;
- VERBOSE(MaxPool2D) << "IFM_W: " << _ctx.at(ifm_index).shape().asFeature().W << std::endl;
- VERBOSE(MaxPool2D) << "OFM_H: " << _ctx.at(ofm_index).shape().asFeature().H << std::endl;
- VERBOSE(MaxPool2D) << "OFM_W: " << _ctx.at(ofm_index).shape().asFeature().W << std::endl;
- VERBOSE(MaxPool2D) << "KER_H: " << kh << std::endl;
- VERBOSE(MaxPool2D) << "KER_W: " << kw << std::endl;
- VERBOSE(MaxPool2D) << "STRIDE_H: " << vstride << std::endl;
- VERBOSE(MaxPool2D) << "STRIDE_W: " << hstride << std::endl;
- VERBOSE(MaxPool2D) << "PAD(T): " << param.padding.top << std::endl;
- VERBOSE(MaxPool2D) << "PAD(B): " << param.padding.bottom << std::endl;
- VERBOSE(MaxPool2D) << "PAD(L): " << param.padding.left << std::endl;
- VERBOSE(MaxPool2D) << "PAD(R): " << param.padding.right << std::endl;
-
auto tensors = _tensor_builder;
returnStage([tensors, param](IExecutionBuilder &builder) {
void StageGenerator::visit(const model::operation::AvgPool2DNode &node)
{
- VERBOSE(AvgPool2D) << "generate CPU AvgPool2D" << std::endl;
-
const auto ofm_index{node.getOutputs().at(0)};
const auto ifm_index{node.getInputs().at(model::operation::AvgPool2DNode::Input::INPUT)};
param.activation = static_cast<FuseCode>(_ctx.at(activation_index).asScalar<int32_t>());
- VERBOSE(AvgPool2D) << "IFM_H: " << _ctx.at(ifm_index).shape().asFeature().H << std::endl;
- VERBOSE(AvgPool2D) << "IFM_W: " << _ctx.at(ifm_index).shape().asFeature().W << std::endl;
- VERBOSE(AvgPool2D) << "OFM_H: " << _ctx.at(ofm_index).shape().asFeature().H << std::endl;
- VERBOSE(AvgPool2D) << "OFM_W: " << _ctx.at(ofm_index).shape().asFeature().W << std::endl;
- VERBOSE(AvgPool2D) << "KER_H: " << kh << std::endl;
- VERBOSE(AvgPool2D) << "KER_W: " << kw << std::endl;
- VERBOSE(AvgPool2D) << "STRIDE_H: " << vstride << std::endl;
- VERBOSE(AvgPool2D) << "STRIDE_W: " << hstride << std::endl;
- VERBOSE(AvgPool2D) << "PAD: " << util::to_string(padding_type) << std::endl;
- VERBOSE(AvgPool2D) << "PAD(T): " << param.padding.top << std::endl;
- VERBOSE(AvgPool2D) << "PAD(B): " << param.padding.bottom << std::endl;
- VERBOSE(AvgPool2D) << "PAD(L): " << param.padding.left << std::endl;
- VERBOSE(AvgPool2D) << "PAD(R): " << param.padding.right << std::endl;
-
auto tensors = _tensor_builder;
returnStage([tensors, param](IExecutionBuilder &builder) {
void StageGenerator::visit(const model::operation::ConcatNode &node)
{
- VERBOSE(Concat) << "generate CPU Concat" << std::endl;
-
const auto ofm_index{node.getOutputs().at(0)};
const auto axis_index{node.param().axis_index};
void StageGenerator::visit(const model::operation::FullyConnectedNode &node)
{
- VERBOSE(FullyConnected) << "generate CPU FullyConnected" << std::endl;
-
using model::operation::FullyConnectedNode;
const auto output_index{node.getOutputs().at(0)};
void StageGenerator::visit(const model::operation::SoftmaxNode &node)
{
- VERBOSE(Softmax) << "generate CPU Softmax" << std::endl;
-
const auto output_index{node.getOutputs().at(0)};
const auto input_index{node.getInputs().at(model::operation::SoftmaxNode::Input::INPUT)};
const auto scale_index{node.param().scale_index};
void StageGenerator::visit(const model::operation::PermuteNode &node)
{
- VERBOSE(Permute) << "generate CPU Permute" << std::endl;
-
const auto output_index{node.getOutputs().at(0)};
const auto input_index{node.getInputs().at(0)};
});
}
-void StageGenerator::visit(const model::operation::AddNode &)
-{
- VERBOSE(Add) << "generate CPU Add" << std::endl;
-
- throw std::runtime_error("NYI");
-}
+void StageGenerator::visit(const model::operation::AddNode &) { throw std::runtime_error("NYI"); }
} // namespace neurun
} // namespace backend