Skip to content

Commit

Permalink
src: common: lnorm: work around for msvc compiler bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dzarukin committed Jun 17, 2024
1 parent 060df4e commit 487d4b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/common/layer_normalization_pd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ struct layer_normalization_fwd_pd_t : public layer_normalization_pd_t {
+ n_binary_po_inputs();
}
int n_outputs() const override {
return 1 + 2 * (!stats_are_src()) * is_training();
// Work around for MSVC 19.40.33811 which over-optimizes the expression
// and would make `n_training_outs` return `0` even when both functions
// return `1`.
int n_training_outs = 2 * (!stats_are_src()) * is_training();
return 1 + n_training_outs;
}

protected:
Expand Down

0 comments on commit 487d4b3

Please sign in to comment.