diff --git a/docs/main/_images/RReLU.png b/docs/main/_images/RReLU.png index 18ad95028015..1bba722d8d3a 100644 Binary files a/docs/main/_images/RReLU.png and b/docs/main/_images/RReLU.png differ diff --git a/docs/main/_modules/index.html b/docs/main/_modules/index.html index a780fc7a29b8..1e3f10a0b15d 100644 --- a/docs/main/_modules/index.html +++ b/docs/main/_modules/index.html @@ -230,7 +230,7 @@
device_type = torch.device(device_type).type
m = sys.modules[__name__]
if hasattr(m, device_type):
- raise RuntimeError("The runtime module of '{}' has already "
- "been registered with '{}'".format(device_type, getattr(m, device_type)))
+ raise RuntimeError(f"The runtime module of '{device_type}' has already "
+ f"been registered with '{getattr(m, device_type)}'")
setattr(m, device_type, module)
torch_module_name = '.'.join([__name__, device_type])
sys.modules[torch_module_name] = module
diff --git a/docs/main/_modules/torch/__config__.html b/docs/main/_modules/torch/__config__.html
index 189fa474a7db..1eaeb0400785 100644
--- a/docs/main/_modules/torch/__config__.html
+++ b/docs/main/_modules/torch/__config__.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/_jit_internal.html b/docs/main/_modules/torch/_jit_internal.html
index 7f2af49f7a5e..eb07e48ed879 100644
--- a/docs/main/_modules/torch/_jit_internal.html
+++ b/docs/main/_modules/torch/_jit_internal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/_lobpcg.html b/docs/main/_modules/torch/_lobpcg.html
index 878f7ba21393..d2e4bff6e344 100644
--- a/docs/main/_modules/torch/_lobpcg.html
+++ b/docs/main/_modules/torch/_lobpcg.html
@@ -230,7 +230,7 @@
@@ -1073,8 +1073,8 @@ Source code for torch._lobpcg
if m < 3 * n:
raise ValueError(
- "LPBPCG algorithm is not applicable when the number of A rows (={})"
- " is smaller than 3 x the number of requested eigenpairs (={})".format(m, n)
+ f"LPBPCG algorithm is not applicable when the number of A rows (={m})"
+ f" is smaller than 3 x the number of requested eigenpairs (={n})"
)
method = "ortho" if method is None else method
@@ -1610,9 +1610,7 @@ Source code for torch._lobpcg
assert B is not None
raise ValueError(
"Overdetermined shape of U:"
- " #B-cols(={}) >= #U-cols(={}) + #V-cols(={}) must hold".format(
- B.shape[-1], U.shape[-1], V.shape[-1]
- )
+ f" #B-cols(={B.shape[-1]}) >= #U-cols(={U.shape[-1]}) + #V-cols(={V.shape[-1]}) must hold"
)
self.ivars["ortho_i"] = i
self.ivars["ortho_j"] = j
diff --git a/docs/main/_modules/torch/_logging/_internal.html b/docs/main/_modules/torch/_logging/_internal.html
index 5e4a4d776034..bf4711430d39 100644
--- a/docs/main/_modules/torch/_logging/_internal.html
+++ b/docs/main/_modules/torch/_logging/_internal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/_lowrank.html b/docs/main/_modules/torch/_lowrank.html
index 6bf857ea87d5..054b182c5203 100644
--- a/docs/main/_modules/torch/_lowrank.html
+++ b/docs/main/_modules/torch/_lowrank.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/_tensor.html b/docs/main/_modules/torch/_tensor.html
index 7e88a89d1c07..d511d4c17bf1 100644
--- a/docs/main/_modules/torch/_tensor.html
+++ b/docs/main/_modules/torch/_tensor.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/_tensor_str.html b/docs/main/_modules/torch/_tensor_str.html
index 52b3b163b62a..8b82346e74fa 100644
--- a/docs/main/_modules/torch/_tensor_str.html
+++ b/docs/main/_modules/torch/_tensor_str.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/_utils.html b/docs/main/_modules/torch/_utils.html
index cfeeca7d374d..2421a962097b 100644
--- a/docs/main/_modules/torch/_utils.html
+++ b/docs/main/_modules/torch/_utils.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/amp/autocast_mode.html b/docs/main/_modules/torch/amp/autocast_mode.html
index 875d11902694..5dc84ee2d1fa 100644
--- a/docs/main/_modules/torch/amp/autocast_mode.html
+++ b/docs/main/_modules/torch/amp/autocast_mode.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/modules/fused.html b/docs/main/_modules/torch/ao/nn/intrinsic/modules/fused.html
index dc17674819f0..5de9ebb53176 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/modules/fused.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/modules/fused.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/conv_fused.html b/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/conv_fused.html
index 40f0f65d4d9b..214e4dc5d79b 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/conv_fused.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/conv_fused.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/linear_relu.html b/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/linear_relu.html
index ab3d4ef2ad29..70e33fd8ec17 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/linear_relu.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/qat/modules/linear_relu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/dynamic/modules/linear_relu.html b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/dynamic/modules/linear_relu.html
index 2346a3848cd5..fa9936fc25a0 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/dynamic/modules/linear_relu.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/dynamic/modules/linear_relu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/bn_relu.html b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/bn_relu.html
index fb37711332d4..8a6faac6e29c 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/bn_relu.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/bn_relu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/conv_relu.html b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/conv_relu.html
index 8a02f84d8a93..ad7c82d2f5da 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/conv_relu.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/conv_relu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/linear_relu.html b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/linear_relu.html
index 0796d6c66067..d65d12cd8ccc 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/linear_relu.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/quantized/modules/linear_relu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/qat/dynamic/modules/linear.html b/docs/main/_modules/torch/ao/nn/qat/dynamic/modules/linear.html
index 5ab05a1ad54c..9e1d807830b9 100644
--- a/docs/main/_modules/torch/ao/nn/qat/dynamic/modules/linear.html
+++ b/docs/main/_modules/torch/ao/nn/qat/dynamic/modules/linear.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/qat/modules/conv.html b/docs/main/_modules/torch/ao/nn/qat/modules/conv.html
index c5cf5ce082c9..dce746203d38 100644
--- a/docs/main/_modules/torch/ao/nn/qat/modules/conv.html
+++ b/docs/main/_modules/torch/ao/nn/qat/modules/conv.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/qat/modules/linear.html b/docs/main/_modules/torch/ao/nn/qat/modules/linear.html
index c67b8da1d1c7..65d0bbd475eb 100644
--- a/docs/main/_modules/torch/ao/nn/qat/modules/linear.html
+++ b/docs/main/_modules/torch/ao/nn/qat/modules/linear.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantizable/modules/activation.html b/docs/main/_modules/torch/ao/nn/quantizable/modules/activation.html
index 52d8aa201747..06569e8dfe89 100644
--- a/docs/main/_modules/torch/ao/nn/quantizable/modules/activation.html
+++ b/docs/main/_modules/torch/ao/nn/quantizable/modules/activation.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantizable/modules/rnn.html b/docs/main/_modules/torch/ao/nn/quantizable/modules/rnn.html
index 679010c1ac09..cfcb019e7843 100644
--- a/docs/main/_modules/torch/ao/nn/quantizable/modules/rnn.html
+++ b/docs/main/_modules/torch/ao/nn/quantizable/modules/rnn.html
@@ -230,7 +230,7 @@
@@ -777,8 +777,8 @@ Source code for torch.ao.nn.quantizable.modules.rnn
if num_layers == 1:
warnings.warn("dropout option adds dropout after all but last "
"recurrent layer, so non-zero dropout expects "
- "num_layers greater than 1, but got dropout={} "
- "and num_layers={}".format(dropout, num_layers))
+ f"num_layers greater than 1, but got dropout={dropout} "
+ f"and num_layers={num_layers}")
layers = [_LSTMLayer(self.input_size, self.hidden_size,
self.bias, batch_first=False,
diff --git a/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/linear.html b/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/linear.html
index d39d9754d20b..2b8f320ef341 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/linear.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/linear.html
@@ -230,7 +230,7 @@
@@ -564,7 +564,7 @@ Source code for torch.ao.nn.quantized.dynamic.modules.linear
weight_observer = default_dynamic_qconfig.weight()
dtype = weight_observer.dtype
assert dtype in [torch.qint8, torch.float16], "The only supported dtypes for " \
- "dynamic quantized linear are qint8 and float16 got: {}".format(dtype)
+ f"dynamic quantized linear are qint8 and float16 got: {dtype}"
weight_observer(mod.weight)
if dtype == torch.qint8:
qweight = _quantize_weight(mod.weight.float(), weight_observer)
diff --git a/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/rnn.html b/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/rnn.html
index 707ca973854d..86d024644b65 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/rnn.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/dynamic/modules/rnn.html
@@ -230,7 +230,7 @@
@@ -552,8 +552,8 @@ Source code for torch.ao.nn.quantized.dynamic.modules.rnn
if dropout > 0 and num_layers == 1: # type: ignore[operator]
warnings.warn("dropout option adds dropout after all but last "
"recurrent layer, so non-zero dropout expects "
- "num_layers greater than 1, but got dropout={} and "
- "num_layers={}".format(dropout, num_layers))
+ f"num_layers greater than 1, but got dropout={dropout} and "
+ f"num_layers={num_layers}")
if mode == 'LSTM':
gate_size = 4 * hidden_size
diff --git a/docs/main/_modules/torch/ao/nn/quantized/functional.html b/docs/main/_modules/torch/ao/nn/quantized/functional.html
index bf84974e4975..4c9fb72cc3ff 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/functional.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/functional.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/activation.html b/docs/main/_modules/torch/ao/nn/quantized/modules/activation.html
index 1ed32531b9b1..b76807c52cfb 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/activation.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/activation.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/batchnorm.html b/docs/main/_modules/torch/ao/nn/quantized/modules/batchnorm.html
index 34e022d4662d..42a32ebe73ee 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/batchnorm.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/batchnorm.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/conv.html b/docs/main/_modules/torch/ao/nn/quantized/modules/conv.html
index 632c0050d7b2..a4b75a400652 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/conv.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/conv.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/embedding_ops.html b/docs/main/_modules/torch/ao/nn/quantized/modules/embedding_ops.html
index 04524c36f135..5cdec0747e14 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/embedding_ops.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/embedding_ops.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/functional_modules.html b/docs/main/_modules/torch/ao/nn/quantized/modules/functional_modules.html
index c1d871bbe412..3c09a2c777c8 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/functional_modules.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/functional_modules.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/linear.html b/docs/main/_modules/torch/ao/nn/quantized/modules/linear.html
index 0bbd8c4df000..2770aadc6a37 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/linear.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/linear.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/modules/normalization.html b/docs/main/_modules/torch/ao/nn/quantized/modules/normalization.html
index c46d579dda98..3ef1aee03266 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/normalization.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/normalization.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/ns/_numeric_suite.html b/docs/main/_modules/torch/ao/ns/_numeric_suite.html
index 3a355112021b..1b0119bf8c35 100644
--- a/docs/main/_modules/torch/ao/ns/_numeric_suite.html
+++ b/docs/main/_modules/torch/ao/ns/_numeric_suite.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/ns/_numeric_suite_fx.html b/docs/main/_modules/torch/ao/ns/_numeric_suite_fx.html
index 478f148ea427..0b6016d4afab 100644
--- a/docs/main/_modules/torch/ao/ns/_numeric_suite_fx.html
+++ b/docs/main/_modules/torch/ao/ns/_numeric_suite_fx.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/ns/fx/utils.html b/docs/main/_modules/torch/ao/ns/fx/utils.html
index 66615d81b250..87048f0c8492 100644
--- a/docs/main/_modules/torch/ao/ns/fx/utils.html
+++ b/docs/main/_modules/torch/ao/ns/fx/utils.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization.html b/docs/main/_modules/torch/ao/quantization.html
index dce43f1a0b28..51083e089e92 100644
--- a/docs/main/_modules/torch/ao/quantization.html
+++ b/docs/main/_modules/torch/ao/quantization.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/backend_config/backend_config.html b/docs/main/_modules/torch/ao/quantization/backend_config/backend_config.html
index 9f999df2ef55..5c982ab1902c 100644
--- a/docs/main/_modules/torch/ao/quantization/backend_config/backend_config.html
+++ b/docs/main/_modules/torch/ao/quantization/backend_config/backend_config.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/fake_quantize.html b/docs/main/_modules/torch/ao/quantization/fake_quantize.html
index c491fe0d7172..2d912fe13b48 100644
--- a/docs/main/_modules/torch/ao/quantization/fake_quantize.html
+++ b/docs/main/_modules/torch/ao/quantization/fake_quantize.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/fuse_modules.html b/docs/main/_modules/torch/ao/quantization/fuse_modules.html
index 59f2fd3abc5f..deadceaaffbd 100644
--- a/docs/main/_modules/torch/ao/quantization/fuse_modules.html
+++ b/docs/main/_modules/torch/ao/quantization/fuse_modules.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/fx/custom_config.html b/docs/main/_modules/torch/ao/quantization/fx/custom_config.html
index c89e4863fc6c..1905ae6e1c61 100644
--- a/docs/main/_modules/torch/ao/quantization/fx/custom_config.html
+++ b/docs/main/_modules/torch/ao/quantization/fx/custom_config.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/observer.html b/docs/main/_modules/torch/ao/quantization/observer.html
index db4b266dc47e..cc09b6a3616c 100644
--- a/docs/main/_modules/torch/ao/quantization/observer.html
+++ b/docs/main/_modules/torch/ao/quantization/observer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/qconfig.html b/docs/main/_modules/torch/ao/quantization/qconfig.html
index 055627538f03..38a8f1cf9338 100644
--- a/docs/main/_modules/torch/ao/quantization/qconfig.html
+++ b/docs/main/_modules/torch/ao/quantization/qconfig.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html b/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html
index 8294b92fcd33..150e6ea2c090 100644
--- a/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html
+++ b/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/quantize.html b/docs/main/_modules/torch/ao/quantization/quantize.html
index 401b7bc3d8b4..734b1ed74764 100644
--- a/docs/main/_modules/torch/ao/quantization/quantize.html
+++ b/docs/main/_modules/torch/ao/quantization/quantize.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/quantize_fx.html b/docs/main/_modules/torch/ao/quantization/quantize_fx.html
index 9c2408034384..2d8a2dbbfec8 100644
--- a/docs/main/_modules/torch/ao/quantization/quantize_fx.html
+++ b/docs/main/_modules/torch/ao/quantization/quantize_fx.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/stubs.html b/docs/main/_modules/torch/ao/quantization/stubs.html
index 896354a3d245..7034982b49b2 100644
--- a/docs/main/_modules/torch/ao/quantization/stubs.html
+++ b/docs/main/_modules/torch/ao/quantization/stubs.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/autograd.html b/docs/main/_modules/torch/autograd.html
index cae62f0e3193..c2950ace8dc8 100644
--- a/docs/main/_modules/torch/autograd.html
+++ b/docs/main/_modules/torch/autograd.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/autograd/anomaly_mode.html b/docs/main/_modules/torch/autograd/anomaly_mode.html
index 1be8258a5100..4d21fabd4fad 100644
--- a/docs/main/_modules/torch/autograd/anomaly_mode.html
+++ b/docs/main/_modules/torch/autograd/anomaly_mode.html
@@ -230,7 +230,7 @@
@@ -461,8 +461,6 @@
Source code for torch.autograd.anomaly_mode
import warnings
-from typing import Any
-
import torch
__all__ = ["detect_anomaly", "set_detect_anomaly"]
@@ -549,7 +547,7 @@ Source code for torch.autograd.anomaly_mode
def __enter__(self) -> None:
torch.set_anomaly_enabled(True, self.check_nan)
- def __exit__(self, *args: Any) -> None:
+ def __exit__(self, *args: object) -> None:
torch.set_anomaly_enabled(self.prev, self.prev_check_nan)
@@ -578,7 +576,7 @@ Source code for torch.autograd.anomaly_mode
def __enter__(self) -> None:
pass
- def __exit__(self, *args: Any) -> None:
+ def __exit__(self, *args: object) -> None:
torch.set_anomaly_enabled(self.prev, self.prev_check_nan)
diff --git a/docs/main/_modules/torch/autograd/forward_ad.html b/docs/main/_modules/torch/autograd/forward_ad.html
index 51bc0ac92c87..d334566ec100 100644
--- a/docs/main/_modules/torch/autograd/forward_ad.html
+++ b/docs/main/_modules/torch/autograd/forward_ad.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/autograd/function.html b/docs/main/_modules/torch/autograd/function.html
index 0f196d93fca3..41672c53d26b 100644
--- a/docs/main/_modules/torch/autograd/function.html
+++ b/docs/main/_modules/torch/autograd/function.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/autograd/functional.html b/docs/main/_modules/torch/autograd/functional.html
index 324fd4cc942d..1af7ee41d139 100644
--- a/docs/main/_modules/torch/autograd/functional.html
+++ b/docs/main/_modules/torch/autograd/functional.html
@@ -230,7 +230,7 @@
@@ -494,17 +494,13 @@ Source code for torch.autograd.functional
if not isinstance(el, torch.Tensor):
if is_inp_tuple:
raise TypeError(
- "The {} given to {} must be either a Tensor or a tuple of Tensors but the"
- " value at index {} has type {}.".format(
- arg_name, fn_name, i, type(el)
- )
+ f"The {arg_name} given to {fn_name} must be either a Tensor or a tuple of Tensors but the"
+ f" value at index {i} has type {type(el)}."
)
else:
raise TypeError(
- "The {} given to {} must be either a Tensor or a tuple of Tensors but the"
- " given {} has type {}.".format(
- arg_name, fn_name, arg_name, type(el)
- )
+ f"The {arg_name} given to {fn_name} must be either a Tensor or a tuple of Tensors but the"
+ f" given {arg_name} has type {type(el)}."
)
return is_inp_tuple, inp
@@ -595,37 +591,35 @@ Source code for torch.autograd.functional
if inp is None:
# This can only be reached for grad_inputs.
raise RuntimeError(
- "The output of the user-provided function is independent of input {}."
- " This is not allowed in strict mode.".format(i)
+ f"The output of the user-provided function is independent of input {i}."
+ " This is not allowed in strict mode."
)
if not inp.requires_grad:
if input_type == "hessian":
raise RuntimeError(
- "The hessian of the user-provided function with respect to input {}"
+ f"The hessian of the user-provided function with respect to input {i}"
" is independent of the input. This is not allowed in strict mode."
" You should ensure that your function is thrice differentiable and that"
- " the hessian depends on the inputs.".format(i)
+ " the hessian depends on the inputs."
)
elif input_type == "jacobian":
raise RuntimeError(
"While computing the hessian, found that the jacobian of the user-provided"
- " function with respect to input {} is independent of the input. This is not"
+ f" function with respect to input {i} is independent of the input. This is not"
" allowed in strict mode. You should ensure that your function is twice"
" differentiable and that the jacobian depends on the inputs (this would be"
- " violated by a linear function for example).".format(i)
+ " violated by a linear function for example)."
)
elif input_type == "grad_inputs":
raise RuntimeError(
- "The gradient with respect to input {} is independent of the inputs of the"
- " user-provided function. This is not allowed in strict mode.".format(
- i
- )
+ f"The gradient with respect to input {i} is independent of the inputs of the"
+ " user-provided function. This is not allowed in strict mode."
)
else:
raise RuntimeError(
- "Output {} of the user-provided function does not require gradients."
+ f"Output {i} of the user-provided function does not require gradients."
" The outputs must be computed in a differentiable manner from the input"
- " when running in strict mode.".format(i)
+ " when running in strict mode."
)
@@ -682,27 +676,25 @@ Source code for torch.autograd.functional
if stage == "back":
raise RuntimeError(
"The output of the user-provided function is independent of "
- "input {}. This is not allowed in strict mode.".format(i)
+ f"input {i}. This is not allowed in strict mode."
)
elif stage == "back_trick":
raise RuntimeError(
- "The gradient with respect to the input is independent of entry {}"
+ f"The gradient with respect to the input is independent of entry {i}"
" in the grad_outputs when using the double backward trick to compute"
- " forward mode gradients. This is not allowed in strict mode.".format(
- i
- )
+ " forward mode gradients. This is not allowed in strict mode."
)
elif stage == "double_back":
raise RuntimeError(
"The jacobian of the user-provided function is independent of "
- "input {}. This is not allowed in strict mode.".format(i)
+ f"input {i}. This is not allowed in strict mode."
)
else:
raise RuntimeError(
"The hessian of the user-provided function is independent of "
- "entry {} in the grad_jacobian. This is not allowed in strict "
+ f"entry {i} in the grad_jacobian. This is not allowed in strict "
"mode as it prevents from using the double backward trick to "
- "replace forward mode AD.".format(i)
+ "replace forward mode AD."
)
grads_i = torch.zeros_like(refs[i])
@@ -711,16 +703,12 @@ Source code for torch.autograd.functional
if "double" not in stage:
raise RuntimeError(
"The jacobian of the user-provided function is independent of "
- "input {}. This is not allowed in strict mode when create_graph=True.".format(
- i
- )
+ f"input {i}. This is not allowed in strict mode when create_graph=True."
)
else:
raise RuntimeError(
"The hessian of the user-provided function is independent of "
- "input {}. This is not allowed in strict mode when create_graph=True.".format(
- i
- )
+ f"input {i}. This is not allowed in strict mode when create_graph=True."
)
res += (grads_i,)
@@ -1272,17 +1260,17 @@ Source code for torch.autograd.functional
if strict and create_graph and not vj_el.requires_grad:
msg = (
"The jacobian of the user-provided function is "
- "independent of input {}. This is not allowed in "
- "strict mode when create_graph=True.".format(i)
+ f"independent of input {i}. This is not allowed in "
+ "strict mode when create_graph=True."
)
raise RuntimeError(msg)
jac_i_el.append(vj_el)
else:
if strict:
msg = (
- "Output {} of the user-provided function is "
- "independent of input {}. This is not allowed in "
- "strict mode.".format(i, el_idx)
+ f"Output {i} of the user-provided function is "
+ f"independent of input {el_idx}. This is not allowed in "
+ "strict mode."
)
raise RuntimeError(msg)
jac_i_el.append(torch.zeros_like(inp_el))
diff --git a/docs/main/_modules/torch/autograd/grad_mode.html b/docs/main/_modules/torch/autograd/grad_mode.html
index b5d3f72305ed..af90c5e5020a 100644
--- a/docs/main/_modules/torch/autograd/grad_mode.html
+++ b/docs/main/_modules/torch/autograd/grad_mode.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/autograd/gradcheck.html b/docs/main/_modules/torch/autograd/gradcheck.html
index 1deab1b9675e..50a6b7595d20 100644
--- a/docs/main/_modules/torch/autograd/gradcheck.html
+++ b/docs/main/_modules/torch/autograd/gradcheck.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/autograd/graph.html b/docs/main/_modules/torch/autograd/graph.html
index 02edf11cc8c2..1bafaaf85c2b 100644
--- a/docs/main/_modules/torch/autograd/graph.html
+++ b/docs/main/_modules/torch/autograd/graph.html
@@ -230,7 +230,7 @@
@@ -685,7 +685,7 @@ Source code for torch.autograd.graph
self.pack_hook, self.unpack_hook
)
- def __exit__(self, *args: Any):
+ def __exit__(self, *args: object):
torch._C._autograd._pop_saved_tensors_default_hooks()
diff --git a/docs/main/_modules/torch/autograd/profiler.html b/docs/main/_modules/torch/autograd/profiler.html
index 42ef9f374ebf..e9b266b915d7 100644
--- a/docs/main/_modules/torch/autograd/profiler.html
+++ b/docs/main/_modules/torch/autograd/profiler.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/cpu.html b/docs/main/_modules/torch/backends/cpu.html
index 0fe796e35f95..5dd3d209a779 100644
--- a/docs/main/_modules/torch/backends/cpu.html
+++ b/docs/main/_modules/torch/backends/cpu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/cuda.html b/docs/main/_modules/torch/backends/cuda.html
index 357df22113dc..a3931c93a520 100644
--- a/docs/main/_modules/torch/backends/cuda.html
+++ b/docs/main/_modules/torch/backends/cuda.html
@@ -230,7 +230,7 @@
@@ -553,10 +553,8 @@ Source code for torch.backends.cuda
index = torch.cuda._utils._get_device_index(device)
if index < 0 or index >= torch.cuda.device_count():
raise RuntimeError(
- (
- "cufft_plan_cache: expected 0 <= device index < {}, but got "
- "device with index {}"
- ).format(torch.cuda.device_count(), index)
+ f"cufft_plan_cache: expected 0 <= device index < {torch.cuda.device_count()}, but got "
+ f"device with index {index}"
)
if len(self.caches) == 0:
self.caches.extend(
diff --git a/docs/main/_modules/torch/backends/cudnn.html b/docs/main/_modules/torch/backends/cudnn.html
index ea37b6b367e1..7f3eded5d610 100644
--- a/docs/main/_modules/torch/backends/cudnn.html
+++ b/docs/main/_modules/torch/backends/cudnn.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/mkl.html b/docs/main/_modules/torch/backends/mkl.html
index b4d65474b7d0..ff493b3857f8 100644
--- a/docs/main/_modules/torch/backends/mkl.html
+++ b/docs/main/_modules/torch/backends/mkl.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/mkldnn.html b/docs/main/_modules/torch/backends/mkldnn.html
index ee7d396b736d..37acc5563410 100644
--- a/docs/main/_modules/torch/backends/mkldnn.html
+++ b/docs/main/_modules/torch/backends/mkldnn.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/mps.html b/docs/main/_modules/torch/backends/mps.html
index e6602df8b41b..af81068c3f5d 100644
--- a/docs/main/_modules/torch/backends/mps.html
+++ b/docs/main/_modules/torch/backends/mps.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/openmp.html b/docs/main/_modules/torch/backends/openmp.html
index ff218fbc3f74..84c47863d9f8 100644
--- a/docs/main/_modules/torch/backends/openmp.html
+++ b/docs/main/_modules/torch/backends/openmp.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/backends/opt_einsum.html b/docs/main/_modules/torch/backends/opt_einsum.html
index 6cb3eb986890..e3ec335da0c2 100644
--- a/docs/main/_modules/torch/backends/opt_einsum.html
+++ b/docs/main/_modules/torch/backends/opt_einsum.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/compiler.html b/docs/main/_modules/torch/compiler.html
index a46c12f81c47..70cb4bd5bd19 100644
--- a/docs/main/_modules/torch/compiler.html
+++ b/docs/main/_modules/torch/compiler.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cpu.html b/docs/main/_modules/torch/cpu.html
index e025a0de577b..b56e43bc6e59 100644
--- a/docs/main/_modules/torch/cpu.html
+++ b/docs/main/_modules/torch/cpu.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cpu/amp/autocast_mode.html b/docs/main/_modules/torch/cpu/amp/autocast_mode.html
index e78a9674e7a1..a090e6aab003 100644
--- a/docs/main/_modules/torch/cpu/amp/autocast_mode.html
+++ b/docs/main/_modules/torch/cpu/amp/autocast_mode.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda.html b/docs/main/_modules/torch/cuda.html
index bba6e0656d6d..9d9f2e17a361 100644
--- a/docs/main/_modules/torch/cuda.html
+++ b/docs/main/_modules/torch/cuda.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/_sanitizer.html b/docs/main/_modules/torch/cuda/_sanitizer.html
index 7c7bc63c4131..8d22fbc97818 100644
--- a/docs/main/_modules/torch/cuda/_sanitizer.html
+++ b/docs/main/_modules/torch/cuda/_sanitizer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/amp/autocast_mode.html b/docs/main/_modules/torch/cuda/amp/autocast_mode.html
index 02cab67fd228..eb4dc9bad635 100644
--- a/docs/main/_modules/torch/cuda/amp/autocast_mode.html
+++ b/docs/main/_modules/torch/cuda/amp/autocast_mode.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/amp/grad_scaler.html b/docs/main/_modules/torch/cuda/amp/grad_scaler.html
index 20a01b3b3f51..c7ff901c1903 100644
--- a/docs/main/_modules/torch/cuda/amp/grad_scaler.html
+++ b/docs/main/_modules/torch/cuda/amp/grad_scaler.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/graphs.html b/docs/main/_modules/torch/cuda/graphs.html
index 2756e8ff7030..9bf1e2414f07 100644
--- a/docs/main/_modules/torch/cuda/graphs.html
+++ b/docs/main/_modules/torch/cuda/graphs.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/jiterator.html b/docs/main/_modules/torch/cuda/jiterator.html
index 5a7af11919cb..4aaba079e727 100644
--- a/docs/main/_modules/torch/cuda/jiterator.html
+++ b/docs/main/_modules/torch/cuda/jiterator.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/memory.html b/docs/main/_modules/torch/cuda/memory.html
index 413a23b343e2..add734b140d1 100644
--- a/docs/main/_modules/torch/cuda/memory.html
+++ b/docs/main/_modules/torch/cuda/memory.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/nvtx.html b/docs/main/_modules/torch/cuda/nvtx.html
index b59deba0292f..9192258f946d 100644
--- a/docs/main/_modules/torch/cuda/nvtx.html
+++ b/docs/main/_modules/torch/cuda/nvtx.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/random.html b/docs/main/_modules/torch/cuda/random.html
index 4a87de27eb5f..0132af359b01 100644
--- a/docs/main/_modules/torch/cuda/random.html
+++ b/docs/main/_modules/torch/cuda/random.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/cuda/streams.html b/docs/main/_modules/torch/cuda/streams.html
index fad0d4f934fc..f32a1355ae15 100644
--- a/docs/main/_modules/torch/cuda/streams.html
+++ b/docs/main/_modules/torch/cuda/streams.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed.html b/docs/main/_modules/torch/distributed.html
index 63e710bdce21..3c2c752746e3 100644
--- a/docs/main/_modules/torch/distributed.html
+++ b/docs/main/_modules/torch/distributed.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/debugging_hooks.html b/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/debugging_hooks.html
index 7f3bcfffa87c..5a45417b9cf8 100644
--- a/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/debugging_hooks.html
+++ b/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/debugging_hooks.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/default_hooks.html b/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/default_hooks.html
index 0a41456a9750..db562b980b02 100644
--- a/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/default_hooks.html
+++ b/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/default_hooks.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.html b/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.html
index cb9cde52362e..4cae5c613c68 100644
--- a/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.html
+++ b/docs/main/_modules/torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/algorithms/join.html b/docs/main/_modules/torch/distributed/algorithms/join.html
index 0629bf43e913..5dbbd068cfaf 100644
--- a/docs/main/_modules/torch/distributed/algorithms/join.html
+++ b/docs/main/_modules/torch/distributed/algorithms/join.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/autograd.html b/docs/main/_modules/torch/distributed/autograd.html
index 214ac37a5a67..53e0df6ab957 100644
--- a/docs/main/_modules/torch/distributed/autograd.html
+++ b/docs/main/_modules/torch/distributed/autograd.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/default_planner.html b/docs/main/_modules/torch/distributed/checkpoint/default_planner.html
index b837c1dfb412..f1971caedeef 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/default_planner.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/default_planner.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/filesystem.html b/docs/main/_modules/torch/distributed/checkpoint/filesystem.html
index ff224606201b..ac0f7307f686 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/filesystem.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/filesystem.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/planner.html b/docs/main/_modules/torch/distributed/checkpoint/planner.html
index cb842ae6bfd0..47750fbcd074 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/planner.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/planner.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/state_dict_loader.html b/docs/main/_modules/torch/distributed/checkpoint/state_dict_loader.html
index 6d000b8a2a00..f98abf1d45e7 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/state_dict_loader.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/state_dict_loader.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/state_dict_saver.html b/docs/main/_modules/torch/distributed/checkpoint/state_dict_saver.html
index ef6d45ff979c..46e6fb80dc7e 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/state_dict_saver.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/state_dict_saver.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/storage.html b/docs/main/_modules/torch/distributed/checkpoint/storage.html
index c88d1a743488..40ed2a305f41 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/storage.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/storage.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/distributed_c10d.html b/docs/main/_modules/torch/distributed/distributed_c10d.html
index 8045ccea36d0..6b6355c80bd9 100644
--- a/docs/main/_modules/torch/distributed/distributed_c10d.html
+++ b/docs/main/_modules/torch/distributed/distributed_c10d.html
@@ -230,7 +230,7 @@
@@ -1584,9 +1584,9 @@ Source code for torch.distributed.distributed_c10d
if backend == Backend.MPI:
if world_size != -1 or rank != -1:
warnings.warn(
- "For MPI backend, world_size ({}) and rank ({}) "
+ f"For MPI backend, world_size ({world_size}) and rank ({rank}) "
"are ignored since they are assigned by the "
- "MPI runtime.".format(world_size, rank)
+ "MPI runtime."
)
default_pg, _ = _new_process_group_helper(
diff --git a/docs/main/_modules/torch/distributed/elastic/agent/server/api.html b/docs/main/_modules/torch/distributed/elastic/agent/server/api.html
index 8e8be0fb4dc4..5c60f816c306 100644
--- a/docs/main/_modules/torch/distributed/elastic/agent/server/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/agent/server/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/agent/server/local_elastic_agent.html b/docs/main/_modules/torch/distributed/elastic/agent/server/local_elastic_agent.html
index 71da5d8e25d6..3920c3372e37 100644
--- a/docs/main/_modules/torch/distributed/elastic/agent/server/local_elastic_agent.html
+++ b/docs/main/_modules/torch/distributed/elastic/agent/server/local_elastic_agent.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/events.html b/docs/main/_modules/torch/distributed/elastic/events.html
index 76e81a8bcda8..79ed004018d8 100644
--- a/docs/main/_modules/torch/distributed/elastic/events.html
+++ b/docs/main/_modules/torch/distributed/elastic/events.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/events/api.html b/docs/main/_modules/torch/distributed/elastic/events/api.html
index 2d789fa739db..e4f4495ebd7e 100644
--- a/docs/main/_modules/torch/distributed/elastic/events/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/events/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/events/handlers.html b/docs/main/_modules/torch/distributed/elastic/events/handlers.html
index 58793994a7c9..ada7cf08d2b8 100644
--- a/docs/main/_modules/torch/distributed/elastic/events/handlers.html
+++ b/docs/main/_modules/torch/distributed/elastic/events/handlers.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/metrics/api.html b/docs/main/_modules/torch/distributed/elastic/metrics/api.html
index b7142935d0d5..3b1dc4b701c2 100644
--- a/docs/main/_modules/torch/distributed/elastic/metrics/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/metrics/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing.html
index 5224906f4179..d31010d678f3 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html
index 670bac98824b..e65f7be3b6a4 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html
index 9feb8d215673..97453358d2e8 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors/error_handler.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors/error_handler.html
index dd3beceb1ed2..347073538669 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors/error_handler.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors/error_handler.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html
index 66609f6a8a6f..b56de4f4bc50 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.html
index 545603eded6d..5802ff86e5d0 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/c10d_rendezvous_backend.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/dynamic_rendezvous.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/dynamic_rendezvous.html
index e4fb410210e5..5e002d9d448d 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/dynamic_rendezvous.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/dynamic_rendezvous.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous.html
index 721cfa8861e7..a2b12837c1ae 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.html
index d3b14bb56a02..6cdfa6b7f872 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous_backend.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_server.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_server.html
index 3afe6e6aa010..588e8cb5d2e2 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_server.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_server.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_store.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_store.html
index 39f553b189b7..50894391ed1b 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_store.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_store.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/timer/api.html b/docs/main/_modules/torch/distributed/elastic/timer/api.html
index e2790bced46d..9c1e595e468c 100644
--- a/docs/main/_modules/torch/distributed/elastic/timer/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/timer/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/timer/file_based_local_timer.html b/docs/main/_modules/torch/distributed/elastic/timer/file_based_local_timer.html
index 4f96967e4921..4728ec6a4df2 100644
--- a/docs/main/_modules/torch/distributed/elastic/timer/file_based_local_timer.html
+++ b/docs/main/_modules/torch/distributed/elastic/timer/file_based_local_timer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/timer/local_timer.html b/docs/main/_modules/torch/distributed/elastic/timer/local_timer.html
index 16136f18a9a9..1df933e57054 100644
--- a/docs/main/_modules/torch/distributed/elastic/timer/local_timer.html
+++ b/docs/main/_modules/torch/distributed/elastic/timer/local_timer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/fsdp/api.html b/docs/main/_modules/torch/distributed/fsdp/api.html
index 6a7fd72b4516..1e9321b2426b 100644
--- a/docs/main/_modules/torch/distributed/fsdp/api.html
+++ b/docs/main/_modules/torch/distributed/fsdp/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/fsdp/fully_sharded_data_parallel.html b/docs/main/_modules/torch/distributed/fsdp/fully_sharded_data_parallel.html
index 0f94d3309b47..584955166dd6 100644
--- a/docs/main/_modules/torch/distributed/fsdp/fully_sharded_data_parallel.html
+++ b/docs/main/_modules/torch/distributed/fsdp/fully_sharded_data_parallel.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/nn/api/remote_module.html b/docs/main/_modules/torch/distributed/nn/api/remote_module.html
index 21d7a0e311f6..63f5a9a80600 100644
--- a/docs/main/_modules/torch/distributed/nn/api/remote_module.html
+++ b/docs/main/_modules/torch/distributed/nn/api/remote_module.html
@@ -230,7 +230,7 @@
@@ -961,8 +961,8 @@ Source code for torch.distributed.nn.api.remote_module
and k not in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING
):
raise AttributeError(
- "Attribute {} must be either in ``_REMOTE_MODULE_PICKLED_ATTRIBUTES`` or "
- "``_REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING``.".format(k)
+ f"Attribute {k} must be either in ``_REMOTE_MODULE_PICKLED_ATTRIBUTES`` or "
+ "``_REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING``."
)
def _install_generated_methods(self):
@@ -1190,11 +1190,9 @@ Source code for torch.distributed.nn.api.remote_module
# Check if unpickled attributes are all in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING.
elif k not in _REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING:
print(
- "The new attribute ``{}`` of RemoteModule is ignored during RPC pickling. "
+ f"The new attribute ``{k}`` of RemoteModule is ignored during RPC pickling. "
"To pickle this attribute, please add it to ``_REMOTE_MODULE_PICKLED_ATTRIBUTES``. "
- "Otherwise, please explicitly add it to ``_REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING``.".format(
- k
- ),
+ "Otherwise, please explicitly add it to ``_REMOTE_MODULE_ATTRIBUTES_IGNORE_FOR_PICKLING``.",
file=sys.stderr,
)
diff --git a/docs/main/_modules/torch/distributed/optim/optimizer.html b/docs/main/_modules/torch/distributed/optim/optimizer.html
index 5ec36666ec9e..65bc7c42dad2 100644
--- a/docs/main/_modules/torch/distributed/optim/optimizer.html
+++ b/docs/main/_modules/torch/distributed/optim/optimizer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/optim/post_localSGD_optimizer.html b/docs/main/_modules/torch/distributed/optim/post_localSGD_optimizer.html
index e7dd2f76603e..fe904699219b 100644
--- a/docs/main/_modules/torch/distributed/optim/post_localSGD_optimizer.html
+++ b/docs/main/_modules/torch/distributed/optim/post_localSGD_optimizer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/optim/zero_redundancy_optimizer.html b/docs/main/_modules/torch/distributed/optim/zero_redundancy_optimizer.html
index 34fab33d97f0..cc7bffcb5802 100644
--- a/docs/main/_modules/torch/distributed/optim/zero_redundancy_optimizer.html
+++ b/docs/main/_modules/torch/distributed/optim/zero_redundancy_optimizer.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html b/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html
index 5fa348ba60e1..cf2e6553a094 100644
--- a/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html
+++ b/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html
@@ -230,7 +230,7 @@
@@ -573,8 +573,8 @@ Source code for torch.distributed.pipeline.sync.pipe
device = parameter.device
elif device != parameter.device:
raise ValueError(
- 'nn.Module: {}, should have all parameters on a single device,'
- ' please use .to() to place the module on a single device'.format(module))
+ f'nn.Module: {module}, should have all parameters on a single device,'
+ ' please use .to() to place the module on a single device')
return device if device is not None else torch.device("cpu")
diff --git a/docs/main/_modules/torch/distributed/pipeline/sync/skip/skippable.html b/docs/main/_modules/torch/distributed/pipeline/sync/skip/skippable.html
index 5349f22eaae6..74e0d73f77d0 100644
--- a/docs/main/_modules/torch/distributed/pipeline/sync/skip/skippable.html
+++ b/docs/main/_modules/torch/distributed/pipeline/sync/skip/skippable.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc.html b/docs/main/_modules/torch/distributed/rpc.html
index 8a28831982fe..005da6810386 100644
--- a/docs/main/_modules/torch/distributed/rpc.html
+++ b/docs/main/_modules/torch/distributed/rpc.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/api.html b/docs/main/_modules/torch/distributed/rpc/api.html
index b76dada09427..0fcc95f53985 100644
--- a/docs/main/_modules/torch/distributed/rpc/api.html
+++ b/docs/main/_modules/torch/distributed/rpc/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/backend_registry.html b/docs/main/_modules/torch/distributed/rpc/backend_registry.html
index bec6fe64df36..14d47e5e6723 100644
--- a/docs/main/_modules/torch/distributed/rpc/backend_registry.html
+++ b/docs/main/_modules/torch/distributed/rpc/backend_registry.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/functions.html b/docs/main/_modules/torch/distributed/rpc/functions.html
index 4cf532664937..306898d26f39 100644
--- a/docs/main/_modules/torch/distributed/rpc/functions.html
+++ b/docs/main/_modules/torch/distributed/rpc/functions.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/options.html b/docs/main/_modules/torch/distributed/rpc/options.html
index 001d14953640..3045e66a09ba 100644
--- a/docs/main/_modules/torch/distributed/rpc/options.html
+++ b/docs/main/_modules/torch/distributed/rpc/options.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/api.html b/docs/main/_modules/torch/distributed/tensor/parallel/api.html
index e597012bc847..bb7c483c4e54 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/api.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/api.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/ddp.html b/docs/main/_modules/torch/distributed/tensor/parallel/ddp.html
index 3e376803470e..2fcf2b890e09 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/ddp.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/ddp.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/fsdp.html b/docs/main/_modules/torch/distributed/tensor/parallel/fsdp.html
index 2a46ae6653ba..d59b5dcc5765 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/fsdp.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/fsdp.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/style.html b/docs/main/_modules/torch/distributed/tensor/parallel/style.html
index 9b3dbba4e294..bcc587b91f5d 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/style.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/style.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/bernoulli.html b/docs/main/_modules/torch/distributions/bernoulli.html
index 15a4b6bd05ad..e0b1cdc7436e 100644
--- a/docs/main/_modules/torch/distributions/bernoulli.html
+++ b/docs/main/_modules/torch/distributions/bernoulli.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/beta.html b/docs/main/_modules/torch/distributions/beta.html
index 6bc774d7b0a8..488c12e114f1 100644
--- a/docs/main/_modules/torch/distributions/beta.html
+++ b/docs/main/_modules/torch/distributions/beta.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/binomial.html b/docs/main/_modules/torch/distributions/binomial.html
index 5c25b618b880..a8f8f39bdb61 100644
--- a/docs/main/_modules/torch/distributions/binomial.html
+++ b/docs/main/_modules/torch/distributions/binomial.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/categorical.html b/docs/main/_modules/torch/distributions/categorical.html
index bc697af9ac27..1c7595f9378f 100644
--- a/docs/main/_modules/torch/distributions/categorical.html
+++ b/docs/main/_modules/torch/distributions/categorical.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/cauchy.html b/docs/main/_modules/torch/distributions/cauchy.html
index 43d01cb02f48..fdaea8b9e5e5 100644
--- a/docs/main/_modules/torch/distributions/cauchy.html
+++ b/docs/main/_modules/torch/distributions/cauchy.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/chi2.html b/docs/main/_modules/torch/distributions/chi2.html
index 6365e634d032..7827c1b3f41c 100644
--- a/docs/main/_modules/torch/distributions/chi2.html
+++ b/docs/main/_modules/torch/distributions/chi2.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/constraint_registry.html b/docs/main/_modules/torch/distributions/constraint_registry.html
index 7e4e2277ef0d..b006cf5fe4f3 100644
--- a/docs/main/_modules/torch/distributions/constraint_registry.html
+++ b/docs/main/_modules/torch/distributions/constraint_registry.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/constraints.html b/docs/main/_modules/torch/distributions/constraints.html
index e35994bd3a69..799bfef11d70 100644
--- a/docs/main/_modules/torch/distributions/constraints.html
+++ b/docs/main/_modules/torch/distributions/constraints.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/continuous_bernoulli.html b/docs/main/_modules/torch/distributions/continuous_bernoulli.html
index 4da3da3ff052..e18d7e5e9a89 100644
--- a/docs/main/_modules/torch/distributions/continuous_bernoulli.html
+++ b/docs/main/_modules/torch/distributions/continuous_bernoulli.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/dirichlet.html b/docs/main/_modules/torch/distributions/dirichlet.html
index 65b2a0b748d7..3d31f68c5aed 100644
--- a/docs/main/_modules/torch/distributions/dirichlet.html
+++ b/docs/main/_modules/torch/distributions/dirichlet.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/distribution.html b/docs/main/_modules/torch/distributions/distribution.html
index 370176aef180..6927edba52e8 100644
--- a/docs/main/_modules/torch/distributions/distribution.html
+++ b/docs/main/_modules/torch/distributions/distribution.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/exp_family.html b/docs/main/_modules/torch/distributions/exp_family.html
index d605a9bcb12f..fc196b309501 100644
--- a/docs/main/_modules/torch/distributions/exp_family.html
+++ b/docs/main/_modules/torch/distributions/exp_family.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/exponential.html b/docs/main/_modules/torch/distributions/exponential.html
index 90d9a1acbced..9108b7d3168f 100644
--- a/docs/main/_modules/torch/distributions/exponential.html
+++ b/docs/main/_modules/torch/distributions/exponential.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/fishersnedecor.html b/docs/main/_modules/torch/distributions/fishersnedecor.html
index 877db708b741..9da3c86b6595 100644
--- a/docs/main/_modules/torch/distributions/fishersnedecor.html
+++ b/docs/main/_modules/torch/distributions/fishersnedecor.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/gamma.html b/docs/main/_modules/torch/distributions/gamma.html
index eb3f50d260d9..4fa85cb7f9f0 100644
--- a/docs/main/_modules/torch/distributions/gamma.html
+++ b/docs/main/_modules/torch/distributions/gamma.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/geometric.html b/docs/main/_modules/torch/distributions/geometric.html
index 94f5815650b6..9c382f8b738f 100644
--- a/docs/main/_modules/torch/distributions/geometric.html
+++ b/docs/main/_modules/torch/distributions/geometric.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/gumbel.html b/docs/main/_modules/torch/distributions/gumbel.html
index 2ef68580b4be..947294d7b28a 100644
--- a/docs/main/_modules/torch/distributions/gumbel.html
+++ b/docs/main/_modules/torch/distributions/gumbel.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/half_cauchy.html b/docs/main/_modules/torch/distributions/half_cauchy.html
index afc962a0c6ee..bc772bf23857 100644
--- a/docs/main/_modules/torch/distributions/half_cauchy.html
+++ b/docs/main/_modules/torch/distributions/half_cauchy.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/half_normal.html b/docs/main/_modules/torch/distributions/half_normal.html
index 55a8d42b4f0b..ba5254ecf0be 100644
--- a/docs/main/_modules/torch/distributions/half_normal.html
+++ b/docs/main/_modules/torch/distributions/half_normal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/independent.html b/docs/main/_modules/torch/distributions/independent.html
index a5a3a1893df4..a5de4e4177d4 100644
--- a/docs/main/_modules/torch/distributions/independent.html
+++ b/docs/main/_modules/torch/distributions/independent.html
@@ -230,7 +230,7 @@
@@ -504,9 +504,7 @@ Source code for torch.distributions.independent
<
if reinterpreted_batch_ndims > len(base_distribution.batch_shape):
raise ValueError(
"Expected reinterpreted_batch_ndims <= len(base_distribution.batch_shape), "
- "actual {} vs {}".format(
- reinterpreted_batch_ndims, len(base_distribution.batch_shape)
- )
+ f"actual {reinterpreted_batch_ndims} vs {len(base_distribution.batch_shape)}"
)
shape = base_distribution.batch_shape + base_distribution.event_shape
event_dim = reinterpreted_batch_ndims + len(base_distribution.event_shape)
diff --git a/docs/main/_modules/torch/distributions/kl.html b/docs/main/_modules/torch/distributions/kl.html
index 818950922635..2290b07f612e 100644
--- a/docs/main/_modules/torch/distributions/kl.html
+++ b/docs/main/_modules/torch/distributions/kl.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/kumaraswamy.html b/docs/main/_modules/torch/distributions/kumaraswamy.html
index 9a15306b645f..05567de69241 100644
--- a/docs/main/_modules/torch/distributions/kumaraswamy.html
+++ b/docs/main/_modules/torch/distributions/kumaraswamy.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/laplace.html b/docs/main/_modules/torch/distributions/laplace.html
index f440804a9bb6..65aae104995e 100644
--- a/docs/main/_modules/torch/distributions/laplace.html
+++ b/docs/main/_modules/torch/distributions/laplace.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/lkj_cholesky.html b/docs/main/_modules/torch/distributions/lkj_cholesky.html
index 3688a1e772f1..e86704926e24 100644
--- a/docs/main/_modules/torch/distributions/lkj_cholesky.html
+++ b/docs/main/_modules/torch/distributions/lkj_cholesky.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/log_normal.html b/docs/main/_modules/torch/distributions/log_normal.html
index b2ba993a973f..022c4bb17216 100644
--- a/docs/main/_modules/torch/distributions/log_normal.html
+++ b/docs/main/_modules/torch/distributions/log_normal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html b/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html
index 9cbeeb1abe3c..e9fb520e326a 100644
--- a/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html
+++ b/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/mixture_same_family.html b/docs/main/_modules/torch/distributions/mixture_same_family.html
index d81c06bef494..feb45da40d1b 100644
--- a/docs/main/_modules/torch/distributions/mixture_same_family.html
+++ b/docs/main/_modules/torch/distributions/mixture_same_family.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/multinomial.html b/docs/main/_modules/torch/distributions/multinomial.html
index 1473dfdde4fb..668cb5fdc194 100644
--- a/docs/main/_modules/torch/distributions/multinomial.html
+++ b/docs/main/_modules/torch/distributions/multinomial.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/multivariate_normal.html b/docs/main/_modules/torch/distributions/multivariate_normal.html
index 403cda1abc86..9de5db84d0c3 100644
--- a/docs/main/_modules/torch/distributions/multivariate_normal.html
+++ b/docs/main/_modules/torch/distributions/multivariate_normal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/negative_binomial.html b/docs/main/_modules/torch/distributions/negative_binomial.html
index dabdd21a91b4..2839a8e5421d 100644
--- a/docs/main/_modules/torch/distributions/negative_binomial.html
+++ b/docs/main/_modules/torch/distributions/negative_binomial.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/normal.html b/docs/main/_modules/torch/distributions/normal.html
index 14691dfd33a6..4ddadeb67c48 100644
--- a/docs/main/_modules/torch/distributions/normal.html
+++ b/docs/main/_modules/torch/distributions/normal.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/one_hot_categorical.html b/docs/main/_modules/torch/distributions/one_hot_categorical.html
index 66e6d76c8c05..a9bf408d5ba0 100644
--- a/docs/main/_modules/torch/distributions/one_hot_categorical.html
+++ b/docs/main/_modules/torch/distributions/one_hot_categorical.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/pareto.html b/docs/main/_modules/torch/distributions/pareto.html
index 518093b4f35a..3974c7fae637 100644
--- a/docs/main/_modules/torch/distributions/pareto.html
+++ b/docs/main/_modules/torch/distributions/pareto.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/poisson.html b/docs/main/_modules/torch/distributions/poisson.html
index dfba2c6df9e2..939ae5ba49a6 100644
--- a/docs/main/_modules/torch/distributions/poisson.html
+++ b/docs/main/_modules/torch/distributions/poisson.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/relaxed_bernoulli.html b/docs/main/_modules/torch/distributions/relaxed_bernoulli.html
index 72a92cc92402..00ef5080e766 100644
--- a/docs/main/_modules/torch/distributions/relaxed_bernoulli.html
+++ b/docs/main/_modules/torch/distributions/relaxed_bernoulli.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/relaxed_categorical.html b/docs/main/_modules/torch/distributions/relaxed_categorical.html
index 5b6121e374f2..fcf37c7fa2ce 100644
--- a/docs/main/_modules/torch/distributions/relaxed_categorical.html
+++ b/docs/main/_modules/torch/distributions/relaxed_categorical.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/studentT.html b/docs/main/_modules/torch/distributions/studentT.html
index 0f8cc6f43264..2a3dfd57abdf 100644
--- a/docs/main/_modules/torch/distributions/studentT.html
+++ b/docs/main/_modules/torch/distributions/studentT.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/transformed_distribution.html b/docs/main/_modules/torch/distributions/transformed_distribution.html
index d6210447198c..7cfef48cff33 100644
--- a/docs/main/_modules/torch/distributions/transformed_distribution.html
+++ b/docs/main/_modules/torch/distributions/transformed_distribution.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/transforms.html b/docs/main/_modules/torch/distributions/transforms.html
index 88d9f1eaeb9a..2e0f12f8cd8c 100644
--- a/docs/main/_modules/torch/distributions/transforms.html
+++ b/docs/main/_modules/torch/distributions/transforms.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/uniform.html b/docs/main/_modules/torch/distributions/uniform.html
index a63dcba6de13..51937af6ea1e 100644
--- a/docs/main/_modules/torch/distributions/uniform.html
+++ b/docs/main/_modules/torch/distributions/uniform.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/utils.html b/docs/main/_modules/torch/distributions/utils.html
index f642b36914e5..6691428a4238 100644
--- a/docs/main/_modules/torch/distributions/utils.html
+++ b/docs/main/_modules/torch/distributions/utils.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/von_mises.html b/docs/main/_modules/torch/distributions/von_mises.html
index 16e374a70486..09d040a695b7 100644
--- a/docs/main/_modules/torch/distributions/von_mises.html
+++ b/docs/main/_modules/torch/distributions/von_mises.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/weibull.html b/docs/main/_modules/torch/distributions/weibull.html
index ed6d149beae3..f4d46ba462cc 100644
--- a/docs/main/_modules/torch/distributions/weibull.html
+++ b/docs/main/_modules/torch/distributions/weibull.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/distributions/wishart.html b/docs/main/_modules/torch/distributions/wishart.html
index c8e3f6f67132..fb2a71b29c26 100644
--- a/docs/main/_modules/torch/distributions/wishart.html
+++ b/docs/main/_modules/torch/distributions/wishart.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/func.html b/docs/main/_modules/torch/func.html
index 5951a40c2b57..c54a5b3a20d2 100644
--- a/docs/main/_modules/torch/func.html
+++ b/docs/main/_modules/torch/func.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/functional.html b/docs/main/_modules/torch/functional.html
index 33d23843d3b8..0891e4d5baef 100644
--- a/docs/main/_modules/torch/functional.html
+++ b/docs/main/_modules/torch/functional.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/futures.html b/docs/main/_modules/torch/futures.html
index 7020e364f01c..1a889d2baf14 100644
--- a/docs/main/_modules/torch/futures.html
+++ b/docs/main/_modules/torch/futures.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/_symbolic_trace.html b/docs/main/_modules/torch/fx/_symbolic_trace.html
index 125e6e7debbf..e4ccd3c9f813 100644
--- a/docs/main/_modules/torch/fx/_symbolic_trace.html
+++ b/docs/main/_modules/torch/fx/_symbolic_trace.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/graph.html b/docs/main/_modules/torch/fx/graph.html
index 60765a9f15bb..fb69df7b90be 100644
--- a/docs/main/_modules/torch/fx/graph.html
+++ b/docs/main/_modules/torch/fx/graph.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/graph_module.html b/docs/main/_modules/torch/fx/graph_module.html
index 49421a00da12..6f7401434620 100644
--- a/docs/main/_modules/torch/fx/graph_module.html
+++ b/docs/main/_modules/torch/fx/graph_module.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/interpreter.html b/docs/main/_modules/torch/fx/interpreter.html
index 0d5e2fb2fc2c..7f6c393a2008 100644
--- a/docs/main/_modules/torch/fx/interpreter.html
+++ b/docs/main/_modules/torch/fx/interpreter.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/node.html b/docs/main/_modules/torch/fx/node.html
index c4fddb522f41..0aacf5a0a05c 100644
--- a/docs/main/_modules/torch/fx/node.html
+++ b/docs/main/_modules/torch/fx/node.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/proxy.html b/docs/main/_modules/torch/fx/proxy.html
index cb0d1d0d0447..5faf15859a25 100644
--- a/docs/main/_modules/torch/fx/proxy.html
+++ b/docs/main/_modules/torch/fx/proxy.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/fx/subgraph_rewriter.html b/docs/main/_modules/torch/fx/subgraph_rewriter.html
index 65a9a6d45e11..334e8d6cdf89 100644
--- a/docs/main/_modules/torch/fx/subgraph_rewriter.html
+++ b/docs/main/_modules/torch/fx/subgraph_rewriter.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/hub.html b/docs/main/_modules/torch/hub.html
index f220fdd63eff..e56d5d42faa4 100644
--- a/docs/main/_modules/torch/hub.html
+++ b/docs/main/_modules/torch/hub.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/jit.html b/docs/main/_modules/torch/jit.html
index 684babf59ded..dbe49a5bbecd 100644
--- a/docs/main/_modules/torch/jit.html
+++ b/docs/main/_modules/torch/jit.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/jit/_async.html b/docs/main/_modules/torch/jit/_async.html
index 26c289eafaba..0608064b0ced 100644
--- a/docs/main/_modules/torch/jit/_async.html
+++ b/docs/main/_modules/torch/jit/_async.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/jit/_freeze.html b/docs/main/_modules/torch/jit/_freeze.html
index a64b293354de..3905ff74574f 100644
--- a/docs/main/_modules/torch/jit/_freeze.html
+++ b/docs/main/_modules/torch/jit/_freeze.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/jit/_fuser.html b/docs/main/_modules/torch/jit/_fuser.html
index 6eddc42f45c8..8fddeeffed00 100644
--- a/docs/main/_modules/torch/jit/_fuser.html
+++ b/docs/main/_modules/torch/jit/_fuser.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/jit/_script.html b/docs/main/_modules/torch/jit/_script.html
index 67f48bdd246d..e0f4253220f4 100644
--- a/docs/main/_modules/torch/jit/_script.html
+++ b/docs/main/_modules/torch/jit/_script.html
@@ -230,7 +230,7 @@
@@ -718,7 +718,7 @@ Source code for torch.jit._script
else:
raise RuntimeError(
"Cannot re-assign modules in a ScriptModule with non-scripted "
- "module, tried to replace existing module '{}': {}".format(k, v)
+ f"module, tried to replace existing module '{k}': {v}"
)
def __getitem__(self, k):
@@ -1863,7 +1863,7 @@ Source code for torch.jit._script
loc,
"Default parameters on overloads do not affect the runtime so they "
"must equal to the default parameter on the implementation function. Found on "
- "parameter {name}".format(name=name),
+ f"parameter {name}",
)
@@ -1922,9 +1922,9 @@ Source code for torch.jit._script
qual_name = _qualified_name(obj)
if _jit_internal._get_fn_overloads(qual_name) or _try_get_jit_cached_overloads(obj):
raise RuntimeError(
- "Function {} cannot be directly compiled because it"
+ f"Function {qual_name} cannot be directly compiled because it"
" is overloaded. It must be used in a context of a function"
- " where its inputs can determine which overload to call.".format(qual_name)
+ " where its inputs can determine which overload to call."
)
diff --git a/docs/main/_modules/torch/jit/_serialization.html b/docs/main/_modules/torch/jit/_serialization.html
index c6f4747bdfbf..b6cbd9a27bed 100644
--- a/docs/main/_modules/torch/jit/_serialization.html
+++ b/docs/main/_modules/torch/jit/_serialization.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/jit/_trace.html b/docs/main/_modules/torch/jit/_trace.html
index 6dab2d9d8fc5..61b33f986388 100644
--- a/docs/main/_modules/torch/jit/_trace.html
+++ b/docs/main/_modules/torch/jit/_trace.html
@@ -230,7 +230,7 @@
@@ -715,10 +715,8 @@ Source code for torch.jit._trace
out = (out,)
if loss_fn == torch.sum and len(out) != 1:
raise ValueError(
- (
- "Model returns {} outputs, but default loss function "
- "(torch.sum) can only handle a single output"
- ).format(len(out))
+ f"Model returns {len(out)} outputs, but default loss function "
+ "(torch.sum) can only handle a single output"
)
out_vars, _ = _flatten(out)
saved_outs = [
diff --git a/docs/main/_modules/torch/library.html b/docs/main/_modules/torch/library.html
index 1317922328dd..d85133e27549 100644
--- a/docs/main/_modules/torch/library.html
+++ b/docs/main/_modules/torch/library.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/monitor.html b/docs/main/_modules/torch/monitor.html
index cf554343155b..bcd9b6340f93 100644
--- a/docs/main/_modules/torch/monitor.html
+++ b/docs/main/_modules/torch/monitor.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/mps.html b/docs/main/_modules/torch/mps.html
index 05a1cb939a8d..36e232a0c42f 100644
--- a/docs/main/_modules/torch/mps.html
+++ b/docs/main/_modules/torch/mps.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/mps/event.html b/docs/main/_modules/torch/mps/event.html
index 7d78d3cea9e5..a137a09f03c6 100644
--- a/docs/main/_modules/torch/mps/event.html
+++ b/docs/main/_modules/torch/mps/event.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/mps/profiler.html b/docs/main/_modules/torch/mps/profiler.html
index 24c253160f10..dbd4c67fb8c7 100644
--- a/docs/main/_modules/torch/mps/profiler.html
+++ b/docs/main/_modules/torch/mps/profiler.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/multiprocessing.html b/docs/main/_modules/torch/multiprocessing.html
index 47a6cc1e6b3e..685bccc38b5d 100644
--- a/docs/main/_modules/torch/multiprocessing.html
+++ b/docs/main/_modules/torch/multiprocessing.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/multiprocessing/spawn.html b/docs/main/_modules/torch/multiprocessing/spawn.html
index 49c3b6331c9c..cde0712c8509 100644
--- a/docs/main/_modules/torch/multiprocessing/spawn.html
+++ b/docs/main/_modules/torch/multiprocessing/spawn.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/nested.html b/docs/main/_modules/torch/nested.html
index 5327dae96795..f3ff72fd79e1 100644
--- a/docs/main/_modules/torch/nested.html
+++ b/docs/main/_modules/torch/nested.html
@@ -230,7 +230,7 @@
diff --git a/docs/main/_modules/torch/nn/functional.html b/docs/main/_modules/torch/nn/functional.html
index 473cf2aa39c3..501f460cdbc3 100644
--- a/docs/main/_modules/torch/nn/functional.html
+++ b/docs/main/_modules/torch/nn/functional.html
@@ -230,7 +230,7 @@
@@ -1362,9 +1362,7 @@ Source code for torch.nn.functional
if len(output_size) != len(kernel_size):
raise ValueError(
"output_size should be a sequence containing "
- "{} or {} elements, but it has a length of '{}'".format(
- len(kernel_size), len(kernel_size) + 2, len(output_size)
- )
+ f"{len(kernel_size)} or {len(kernel_size) + 2} elements, but it has a length of '{len(output_size)}'"
)
for d in range(len(kernel_size)):
min_size = default_size[d] - stride[d]
@@ -2815,8 +2813,8 @@ Source code for torch.nn.functional
if per_sample_weights is not None and input.size() != per_sample_weights.size():
raise ValueError(
- "embedding_bag: If per_sample_weights ({}) is not None, "
- "then it must have the same shape as the input ({})".format(per_sample_weights.shape, input.shape)
+ f"embedding_bag: If per_sample_weights ({per_sample_weights.shape}) is not None, "
+ f"then it must have the same shape as the input ({input.shape})"
)
if not weight.dim() == 2:
@@ -2834,7 +2832,7 @@ Source code for torch.nn.functional
"if input is 2D, then offsets has to be None"
", as input is treated is a mini-batch of"
" fixed length sequences. However, found "
- "offsets of type {}".format(type_str)
+ f"offsets of type {type_str}"
)
offsets = torch.arange(0, input.numel(), input.size(1), dtype=input.dtype, device=input.device)
@@ -2875,7 +2873,7 @@ Source code for torch.nn.functional
raise NotImplementedError(
"embedding_bag: per_sample_weights was not None. "
"per_sample_weights is only supported for mode='sum' "
- "(got mode='{}'). Please open a feature request on GitHub.".format(mode)
+ f"(got mode='{mode}'). Please open a feature request on GitHub."
)
ret, _, _, _ = torch.embedding_bag(
@@ -3682,9 +3680,9 @@ Source code for torch.nn.functional
)
if not (target.size() == input.size()):
warnings.warn(
- "Using a target size ({}) that is different to the input size ({}). "
+ f"Using a target size ({target.size()}) that is different to the input size ({input.size()}). "
"This will likely lead to incorrect results due to broadcasting. "
- "Please ensure they have the same size.".format(target.size(), input.size()),
+ "Please ensure they have the same size.",
stacklevel=2,
)
if size_average is not None or reduce is not None:
@@ -3719,9 +3717,9 @@ Source code for torch.nn.functional
delta=delta,
)
if not (target.size() == input.size()):
- warnings.warn("Using a target size ({}) that is different to the input size ({}). "
+ warnings.warn(f"Using a target size ({target.size()}) that is different to the input size ({input.size()}). "
"This will likely lead to incorrect results due to broadcasting. "
- "Please ensure they have the same size.".format(target.size(), input.size()),
+ "Please ensure they have the same size.",
stacklevel=2)
expanded_input, expanded_target = torch.broadcast_tensors(input, target)
@@ -3747,9 +3745,9 @@ Source code for torch.nn.functional
)
if not (target.size() == input.size()):
warnings.warn(
- "Using a target size ({}) that is different to the input size ({}). "
+ f"Using a target size ({target.size()}) that is different to the input size ({input.size()}). "
"This will likely lead to incorrect results due to broadcasting. "
- "Please ensure they have the same size.".format(target.size(), input.size()),
+ "Please ensure they have the same size.",
stacklevel=2,
)
if size_average is not None or reduce is not None:
@@ -3778,9 +3776,9 @@ Source code for torch.nn.functional
)
if not (target.size() == input.size()):
warnings.warn(
- "Using a target size ({}) that is different to the input size ({}). "
+ f"Using a target size ({target.size()}) that is different to the input size ({input.size()}). "
"This will likely lead to incorrect results due to broadcasting. "
- "Please ensure they have the same size.".format(target.size(), input.size()),
+ "Please ensure they have the same size.",
stacklevel=2,
)
if size_average is not None or reduce is not None:
@@ -4503,8 +4501,8 @@ Source code for torch.nn.functional
raise NotImplementedError(
"Input Error: Only 3D, 4D and 5D input Tensors supported"
- " (got {}D) for the modes: nearest | linear | bilinear | bicubic | trilinear | area | nearest-exact"
- " (got {})".format(input.dim(), mode)
+ f" (got {input.dim()}D) for the modes: nearest | linear | bilinear | bicubic | trilinear | area | nearest-exact"
+ f" (got {mode})"
)
@@ -4736,7 +4734,7 @@ Source code for torch.nn.functional
raise ValueError(
"nn.functional.grid_sample(): expected padding_mode "
"to be 'zeros', 'border', or 'reflection', "
- "but got: '{}'".format(padding_mode)
+ f"but got: '{padding_mode}'"
)
if mode == "bilinear":
@@ -4844,7 +4842,7 @@ Source code for torch.nn.functional
raise NotImplementedError(
"affine_grid only supports 4D and 5D sizes, "
"for 2D and 3D affine transforms, respectively. "
- "Got size {}.".format(size)
+ f"Got size {size}."
)
# check for empty span
if align_corners and min(spatial_size) == 1:
diff --git a/docs/main/_modules/torch/nn/init.html b/docs/main/_modules/torch/nn/init.html
index 62953e72a742..526a0f125437 100644
--- a/docs/main/_modules/torch/nn/init.html
+++ b/docs/main/_modules/torch/nn/init.html
@@ -230,7 +230,7 @@
@@ -1002,14 +1002,13 @@ Source code for torch.nn.init