Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix sanity
Browse files Browse the repository at this point in the history
  • Loading branch information
bgawrych committed Oct 22, 2020
1 parent f704efc commit 0312229
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/operator/nn/mkldnn/mkldnn_rnn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ inline int GetRnnGatesNum(int mode) {
// Bug in oneDNN >= 1.6 in memory descriptor comparision operators.
// for specific dims and strides in descriptors == operator can return `true`
// but get_size() function will return different size
// TODO(bgawrych): Remove with oneDNN 1.7 upgrade
// TODO(bgawrych): Remove with oneDNN 1.7 upgrade
bool CheckMemDescEquality(const mkldnn::memory::desc &left, const mkldnn::memory::desc &right) {
return left == right && left.get_size() == right.get_size();
}
Expand Down Expand Up @@ -830,13 +830,11 @@ void MKLDNNRnnBackward::SetDataGradsMem(

void MKLDNNRnnBackward::SetNativeWeightsGrads() const {
if (!CheckMemDescEquality(this->diff_weights_layer_->get_desc(),
this->diff_weights_layer_r_->get_desc()))
{
this->diff_weights_layer_r_->get_desc())) {
MKLDNNMemoryReorder(*this->diff_weights_layer_, *this->diff_weights_layer_r_);
}
if (!CheckMemDescEquality(this->diff_weights_iter_->get_desc(),
this->diff_weights_iter_r_->get_desc()))
{
this->diff_weights_iter_r_->get_desc())) {
MKLDNNMemoryReorder(*this->diff_weights_iter_, *this->diff_weights_iter_r_);
}
}
Expand Down

0 comments on commit 0312229

Please sign in to comment.