Skip to content

Enhance ProgramDesc constructor taking protobuf string for RNN #8161

Closed
@kexinzhao

Description

@kexinzhao

Right now, when constructing a ProgramDesc instance from a proto::ProgramDesc, there will be error for test_rnn_encoder_decoder.

The reason is the following code:

for (const proto::OpDesc::Attr &attr : desc_.attrs()) {
std::string attr_name = attr.name();
if (attr.type() != proto::AttrType::BLOCK) {
attrs_[attr_name] = GetAttrValue(attr);
} else {
auto bid = attr.block_idx();
attrs_[attr_name] = prog->MutableBlock(bid);
}
}

where it tries to assign a block pointer that hasn't been created yet (because the ProgramDesc constructor calls the BlockDesc constructor one by one following the order of the block idx) as a attribute to a RNN while operator.

This is issue will be fixed together with #8062 and #8059

Metadata

Metadata

Assignees

Labels

预测原名Inference,包含Capi预测问题等

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions