Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip drop if drop rate is zero #7186

Merged
merged 7 commits into from
Jan 6, 2022
2 changes: 1 addition & 1 deletion oneflow/core/functional/impl/nn_functor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ class FusedBiasAddDropoutFunctor {
axis_val += num_axes;
}
JUST(fused_bias_add_mask_attrs.SetAttr<int32_t>("axis", axis_val));
if (p >= 0.0) {
if (p > 0.0) {
return SequenceFunction<Maybe<Tensor>()>([&]() -> Maybe<Tensor> {
return OpInterpUtil::Dispatch<Tensor>(
*random_mask_like_op_, {a},
Expand Down