const auto epsilon = node.param().epsilon;
const auto activation = node.param().activation;
- const auto ofm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(ofm_index), _current_subg_layout);
- const auto ifm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(ifm_index), _current_subg_layout);
- const auto gamma_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(gamma_index), _current_subg_layout);
- const auto beta_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(beta_index), _current_subg_layout);
-
auto ofm_alloc = _tensor_builder->at(ofm_index);
auto ifm_alloc = _tensor_builder->at(ifm_index);
auto gamma_alloc = _tensor_builder->at(gamma_index);
const auto backend_layout = ofm_alloc->layout();
+ const auto ofm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(ofm_index), _current_subg_layout, backend_layout);
+ const auto ifm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(ifm_index), _current_subg_layout, backend_layout);
+ const auto gamma_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(gamma_index), _current_subg_layout, backend_layout);
+ const auto beta_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(beta_index), _current_subg_layout, backend_layout);
+
auto fn = nnfw::cpp14::make_unique<::neurun::backend::srcn::kernel::InstanceNormLayer>();
fn->configure(ifm_alloc->buffer(), ifm_backend_descr, gamma_alloc->buffer(), gamma_backend_descr,
const auto padding = neurun::util::calculatePadding(node.param().padding, ofm_shape, ifm_shape,
stride, ker_width, ker_height);
- const auto ofm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(ofm_index), _current_subg_layout);
- const auto ifm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(ifm_index), _current_subg_layout);
- const auto ker_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(ker_index), model::Layout::UNKNOWN);
-
auto ofm_alloc = _tensor_builder->at(ofm_index);
auto ifm_alloc = _tensor_builder->at(ifm_index);
auto ker_alloc = _tensor_builder->at(ker_index);
+ const auto backend_layout = ofm_alloc->layout();
+ assert(backend_layout == ifm_alloc->layout());
+
+ const auto ofm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(ofm_index), _current_subg_layout, backend_layout);
+ const auto ifm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(ifm_index), _current_subg_layout, backend_layout);
+ const auto ker_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(ker_index), _current_subg_layout, backend_layout);
auto fn = nnfw::cpp14::make_unique<::neurun::backend::srcn::kernel::TransposeConvLayer>();
const auto lhs_index{node.getInputs().at(model::operation::Add::Input::LHS)};
const auto rhs_index{node.getInputs().at(model::operation::Add::Input::RHS)};
- const auto ofm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(ofm_index), _current_subg_layout);
- const auto lhs_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(lhs_index), _current_subg_layout);
- const auto rhs_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
- _ctx.at(rhs_index), _current_subg_layout);
-
const auto activation = node.param().activation;
auto ofm_alloc = _tensor_builder->at(ofm_index).get();
auto lhs_alloc = _tensor_builder->at(lhs_index).get();
auto rhs_alloc = _tensor_builder->at(rhs_index).get();
- const auto frontend_layout = _current_subg_layout;
const auto backend_layout = ofm_alloc->layout();
+ assert(backend_layout == lhs_alloc->layout() && backend_layout == rhs_alloc->layout());
+
+ const auto ofm_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(ofm_index), _current_subg_layout, backend_layout);
+ const auto lhs_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(lhs_index), _current_subg_layout, backend_layout);
+ const auto rhs_backend_descr = ::neurun::backend::srcn::kernel::getTensorDescriptor(
+ _ctx.at(rhs_index), _current_subg_layout, backend_layout);
auto fn = nnfw::cpp14::make_unique<::neurun::backend::srcn::kernel::AddLayer>();
fn->configure(lhs_alloc->buffer(), lhs_backend_descr, rhs_alloc->buffer(), rhs_backend_descr,
- activation, ofm_alloc->buffer(), ofm_backend_descr, frontend_layout,
- backend_layout);
+ activation, ofm_alloc->buffer(), ofm_backend_descr, backend_layout);
_execution_builder->append(std::move(fn));
}