const auto ofm_index{node.getOutputs().at(0)};
const auto ifm_index{node.getInputs().at(model::operation::L2Pool2DNode::Input::INPUT)};
- const auto kh_index{node.param().kh_index};
- const auto kw_index{node.param().kw_index};
-
- const auto vstride_index{node.param().vstride_index};
- const auto hstride_index{node.param().hstride_index};
-
const auto ifm_shape = _ctx.at(ifm_index).shape().asFeature();
const auto ofm_shape = _ctx.at(ofm_index).shape().asFeature();
- const int32_t kh = _ctx.at(kh_index).asScalar<int32_t>();
- const int32_t kw = _ctx.at(kw_index).asScalar<int32_t>();
-
- neurun::model::Stride stride;
-
- stride.vertical = _ctx.at(vstride_index).asScalar<int32_t>();
- stride.horizontal = _ctx.at(hstride_index).asScalar<int32_t>();
-
// Construct operation parameters
struct Param
{
param.ofm_index = ofm_index;
param.ifm_index = ifm_index;
- param.kw = kw;
- param.kh = kh;
-
- param.stride = stride;
+ param.kw = node.param().kw;
+ param.kh = node.param().kh;
+ param.stride = node.param().stride;
param.padding = neurun::util::calculatePadding(node.param().padding, ifm_shape, ofm_shape,
- param.stride, kw, kh);
+ param.stride, param.kw, param.kh);
param.activation = node.param().activation;
auto tensors = _tensor_builder;
// 5 -> Filter Height Index
// 6 -> FuseCode (activation) Index
const auto padding_index = OperandIndex{init_param.inputs[1]};
+ const auto hstride_index = OperandIndex{init_param.inputs[2]};
+ const auto vstride_index = OperandIndex{init_param.inputs[3]};
+ const auto kw_index = OperandIndex{init_param.inputs[4]};
+ const auto kh_index = OperandIndex{init_param.inputs[5]};
const auto activation_index = OperandIndex{init_param.inputs[6]};
param.padding.type =
NNAPIConvert::getPaddingType(operands.at(padding_index).asScalar<PaddingCode>());
- param.hstride_index = OperandIndex{init_param.inputs[2]};
- param.vstride_index = OperandIndex{init_param.inputs[3]};
- param.kw_index = OperandIndex{init_param.inputs[4]};
- param.kh_index = OperandIndex{init_param.inputs[5]};
+ param.stride = makeStride(operands, hstride_index, vstride_index);
+ param.kw = getUint32Scalar(operands, kw_index);
+ param.kh = getUint32Scalar(operands, kh_index);
param.activation =
NNAPIConvert::getFusedActivation(operands.at(activation_index).asScalar<FuseCode>());
}
const auto padding_right_index = OperandIndex{init_param.inputs[2]};
const auto padding_top_index = OperandIndex{init_param.inputs[3]};
const auto padding_bottom_index = OperandIndex{init_param.inputs[4]};
+ const auto hstride_index = OperandIndex{init_param.inputs[5]};
+ const auto vstride_index = OperandIndex{init_param.inputs[6]};
+ const auto kw_index = OperandIndex{init_param.inputs[7]};
+ const auto kh_index = OperandIndex{init_param.inputs[8]};
const auto activation_index = OperandIndex{init_param.inputs[9]};
param.padding.type = PaddingType::EXPLICIT;
param.padding.param = makeExplicitPadding(operands, padding_left_index, padding_right_index,
padding_top_index, padding_bottom_index);
- param.hstride_index = OperandIndex{init_param.inputs[5]};
- param.vstride_index = OperandIndex{init_param.inputs[6]};
- param.kw_index = OperandIndex{init_param.inputs[7]};
- param.kh_index = OperandIndex{init_param.inputs[8]};
+ param.stride = makeStride(operands, hstride_index, vstride_index);
+ param.kw = getUint32Scalar(operands, kw_index);
+ param.kh = getUint32Scalar(operands, kh_index);
param.activation =
NNAPIConvert::getFusedActivation(operands.at(activation_index).asScalar<FuseCode>());
}