Skip to content
Snippets Groups Projects
Commit 88c0687c authored by lixinqi's avatar lixinqi
Browse files

fix batch_axis bugs in ConvFilterGradOp and DecodeOFRecordOp

parent fc5b13bf
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ void ConvFilterGradOp::VirtualGenKernelConf(
Maybe<void> ConvFilterGradOp::InferBatchAxis(
std::function<OptInt64*(const std::string&)> BatchAxis4BnInOp) const {
CHECK_OR_RETURN(*BatchAxis4BnInOp("dy") == *BatchAxis4BnInOp("x"));
*BatchAxis4BnInOp("filter_diff") = *BatchAxis4BnInOp("x");
BatchAxis4BnInOp("filter_diff")->clear_value();
return Maybe<void>::Ok();
}
......
......@@ -76,7 +76,10 @@ LogicalBlobId DecodeOFRecordOp::obn2lbi(const std::string& output_bn) const {
Maybe<void> DecodeOFRecordOp::InferBatchAxis(
std::function<OptInt64*(const std::string&)> BatchAxis4BnInOp) const {
if (op_conf().decode_ofrecord_conf().has_in()) { CHECK_OR_RETURN(BatchAxis4BnInOp(SoleIbn())); }
if (op_conf().decode_ofrecord_conf().has_in()) {
CHECK_OR_RETURN(BatchAxis4BnInOp(SoleIbn())->has_value());
CHECK_EQ_OR_RETURN(BatchAxis4BnInOp(SoleIbn())->value(), 0);
}
for (const auto& obn : output_bns()) { BatchAxis4BnInOp(obn)->set_value(0); }
return Maybe<void>::Ok();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment