Skip to content

Commit

Permalink
fix docs (#7227)
Browse files Browse the repository at this point in the history
Co-authored-by: oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
  • Loading branch information
MARD1NO and oneflow-ci-bot authored Jan 12, 2022
1 parent a7f9a33 commit 483fed7
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions python/oneflow/nn/modules/interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,7 @@ def forward(self, x):
scale_factors = [self.scale_factor for _ in range(dim)]
else:
raise ValueError("either size or scale_factor should be defined")
if self.recompute_scale_factor is None:
if scale_factors is not None:
for scale in scale_factors:
if math.floor(scale) != scale:
warnings.warn(
"The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and now uses scale_factor directly, instead of relying on the computed output size. If you wish to restore the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. "
)
break
elif self.recompute_scale_factor and self.size is not None:
if self.recompute_scale_factor and self.size is not None:
raise ValueError(
"recompute_scale_factor is not meaningful with an explicit size."
)
Expand Down Expand Up @@ -267,9 +259,6 @@ def interpolate(
When scale_factor is specified, if recompute_scale_factor=True,
scale_factor is used to compute the output_size which will then
be used to infer new scales for the interpolation.
The default behavior for recompute_scale_factor changed to False
in 1.6.0, and scale_factor is used in the interpolation
calculation.
For example:
Expand Down

0 comments on commit 483fed7

Please sign in to comment.