diff --git a/docs/main/_images/RReLU.png b/docs/main/_images/RReLU.png index b0cb8293ba5a..4ea6cd618bca 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 5d0baf9e7959..c9e3810c3d73 100644 --- a/docs/main/_modules/index.html +++ b/docs/main/_modules/index.html @@ -242,7 +242,7 @@
"""
_C._log_api_usage_once("torch.compile")
- if sys.version_info >= (3, 12):
- raise RuntimeError("Dynamo is not supported on Python 3.12+")
+ if sys.version_info >= (3, 13):
+ raise RuntimeError("Dynamo is not supported on Python 3.13+")
# Decorator mode
if model is None:
diff --git a/docs/main/_modules/torch/__config__.html b/docs/main/_modules/torch/__config__.html
index 4b766f353b58..cfbbb86e8161 100644
--- a/docs/main/_modules/torch/__config__.html
+++ b/docs/main/_modules/torch/__config__.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/__future__.html b/docs/main/_modules/torch/__future__.html
index 0d3fa717abc1..415229f37856 100644
--- a/docs/main/_modules/torch/__future__.html
+++ b/docs/main/_modules/torch/__future__.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/_jit_internal.html b/docs/main/_modules/torch/_jit_internal.html
index ba556d9ccdd8..f5f6702e91a2 100644
--- a/docs/main/_modules/torch/_jit_internal.html
+++ b/docs/main/_modules/torch/_jit_internal.html
@@ -242,7 +242,7 @@
@@ -528,7 +528,6 @@ Source code for torch._jit_internal
from torch._awaits import _Await
from torch._C import _Await as CAwait, Future as CFuture
from torch._sources import fake_range, get_source_lines_and_file, parse_def
-from torch._utils_internal import log_torchscript_usage
from torch.futures import Future
IS_PY39_PLUS: Final[bool] = sys.version_info >= (3, 9)
@@ -1065,7 +1064,6 @@ Source code for torch._jit_internal
# any compiled methods and wasn't decorated with `@torch.jit.export`
m = torch.jit.script(MyModule())
"""
- log_torchscript_usage("export")
fn._torchscript_modifier = FunctionModifiers.EXPORT
return fn
@@ -1107,7 +1105,6 @@ Source code for torch._jit_internal
# exception raised
m(torch.rand(100))
"""
- log_torchscript_usage("unused")
if isinstance(fn, property):
prop = fn
setattr( # noqa: B010
@@ -1195,7 +1192,6 @@ Source code for torch._jit_internal
import os
os.remove('m.pt')
"""
- log_torchscript_usage("ignore")
if callable(drop):
# used without any args, so drop is actually a function
diff --git a/docs/main/_modules/torch/_lobpcg.html b/docs/main/_modules/torch/_lobpcg.html
index 3d59a905bbbe..d73de618d6c4 100644
--- a/docs/main/_modules/torch/_lobpcg.html
+++ b/docs/main/_modules/torch/_lobpcg.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/_logging/_internal.html b/docs/main/_modules/torch/_logging/_internal.html
index 6e03f282689c..c7ee3d940cf9 100644
--- a/docs/main/_modules/torch/_logging/_internal.html
+++ b/docs/main/_modules/torch/_logging/_internal.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/_lowrank.html b/docs/main/_modules/torch/_lowrank.html
index 59a3a1a73aa5..815f15ec2900 100644
--- a/docs/main/_modules/torch/_lowrank.html
+++ b/docs/main/_modules/torch/_lowrank.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/_tensor.html b/docs/main/_modules/torch/_tensor.html
index 9adb2f546940..8260129c7320 100644
--- a/docs/main/_modules/torch/_tensor.html
+++ b/docs/main/_modules/torch/_tensor.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/_tensor_str.html b/docs/main/_modules/torch/_tensor_str.html
index 8e9434ea7831..3df1839304b2 100644
--- a/docs/main/_modules/torch/_tensor_str.html
+++ b/docs/main/_modules/torch/_tensor_str.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/_utils.html b/docs/main/_modules/torch/_utils.html
index 050ffbb7f384..b6326b69ff06 100644
--- a/docs/main/_modules/torch/_utils.html
+++ b/docs/main/_modules/torch/_utils.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/amp/autocast_mode.html b/docs/main/_modules/torch/amp/autocast_mode.html
index 74bd3f0ab580..cd11a423c7ad 100644
--- a/docs/main/_modules/torch/amp/autocast_mode.html
+++ b/docs/main/_modules/torch/amp/autocast_mode.html
@@ -242,7 +242,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 5ef8b1b98524..2d74f88b37fc 100644
--- a/docs/main/_modules/torch/ao/nn/intrinsic/modules/fused.html
+++ b/docs/main/_modules/torch/ao/nn/intrinsic/modules/fused.html
@@ -242,7 +242,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 5b557fb8402b..5dcc4e0c5a7f 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
@@ -242,7 +242,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 2bb8c3a2f1e2..17349c4801f8 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
@@ -242,7 +242,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 3ace4ddb3cb3..8c1fca4e1d63 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
@@ -242,7 +242,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 86bc3a277887..a6838ec05f32 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
@@ -242,7 +242,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 164ba8098c88..9cb8d8d0d37a 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
@@ -242,7 +242,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 6bbd9831a057..51b222934e91 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
@@ -242,7 +242,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 d886797f2162..5534bd34063e 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
@@ -242,7 +242,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 79d91ebc2e6e..57e6442843d3 100644
--- a/docs/main/_modules/torch/ao/nn/qat/modules/conv.html
+++ b/docs/main/_modules/torch/ao/nn/qat/modules/conv.html
@@ -242,7 +242,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 0194784e7792..99db16361b1f 100644
--- a/docs/main/_modules/torch/ao/nn/qat/modules/linear.html
+++ b/docs/main/_modules/torch/ao/nn/qat/modules/linear.html
@@ -242,7 +242,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 acb38b98c45d..c741ba3b7387 100644
--- a/docs/main/_modules/torch/ao/nn/quantizable/modules/activation.html
+++ b/docs/main/_modules/torch/ao/nn/quantizable/modules/activation.html
@@ -242,7 +242,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 68422c63f58a..d21966d71300 100644
--- a/docs/main/_modules/torch/ao/nn/quantizable/modules/rnn.html
+++ b/docs/main/_modules/torch/ao/nn/quantizable/modules/rnn.html
@@ -242,7 +242,7 @@
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 0d5616637228..04645871a104 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
@@ -242,7 +242,7 @@
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 80066ff9833a..b5b8693173dd 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
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/nn/quantized/functional.html b/docs/main/_modules/torch/ao/nn/quantized/functional.html
index 135815205977..980203d8409c 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/functional.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/functional.html
@@ -242,7 +242,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 e37298e72753..a9637a4775ca 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/activation.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/activation.html
@@ -242,7 +242,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 5a22c760fe40..b170bdae5972 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/batchnorm.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/batchnorm.html
@@ -242,7 +242,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 d8e7280f1bec..ebb60ad685d1 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/conv.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/conv.html
@@ -242,7 +242,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 c548feeddce6..d3d4dd5bb7a9 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
@@ -242,7 +242,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 fb4b4320b66e..cbcf2550f38f 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
@@ -242,7 +242,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 da690c2b211c..13840cdf698d 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/linear.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/linear.html
@@ -242,7 +242,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 d33590836545..fd770989bccc 100644
--- a/docs/main/_modules/torch/ao/nn/quantized/modules/normalization.html
+++ b/docs/main/_modules/torch/ao/nn/quantized/modules/normalization.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/ns/_numeric_suite.html b/docs/main/_modules/torch/ao/ns/_numeric_suite.html
index cb66ba46cb84..0a1a8c49d2c5 100644
--- a/docs/main/_modules/torch/ao/ns/_numeric_suite.html
+++ b/docs/main/_modules/torch/ao/ns/_numeric_suite.html
@@ -242,7 +242,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 e5e454728503..3e9ff093a171 100644
--- a/docs/main/_modules/torch/ao/ns/_numeric_suite_fx.html
+++ b/docs/main/_modules/torch/ao/ns/_numeric_suite_fx.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/ns/fx/utils.html b/docs/main/_modules/torch/ao/ns/fx/utils.html
index 16964a0d9928..1a3ab3496fcb 100644
--- a/docs/main/_modules/torch/ao/ns/fx/utils.html
+++ b/docs/main/_modules/torch/ao/ns/fx/utils.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization.html b/docs/main/_modules/torch/ao/quantization.html
index e90f5d418ae5..ef07de4be82f 100644
--- a/docs/main/_modules/torch/ao/quantization.html
+++ b/docs/main/_modules/torch/ao/quantization.html
@@ -242,7 +242,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 9b0022274120..1e12e326cc69 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
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/fake_quantize.html b/docs/main/_modules/torch/ao/quantization/fake_quantize.html
index 5003138a1a8b..11bfcf08279f 100644
--- a/docs/main/_modules/torch/ao/quantization/fake_quantize.html
+++ b/docs/main/_modules/torch/ao/quantization/fake_quantize.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/fuse_modules.html b/docs/main/_modules/torch/ao/quantization/fuse_modules.html
index 282a93167e58..a9deddbaffd9 100644
--- a/docs/main/_modules/torch/ao/quantization/fuse_modules.html
+++ b/docs/main/_modules/torch/ao/quantization/fuse_modules.html
@@ -242,7 +242,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 f5f1594b6bef..247e775f4cb5 100644
--- a/docs/main/_modules/torch/ao/quantization/fx/custom_config.html
+++ b/docs/main/_modules/torch/ao/quantization/fx/custom_config.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/observer.html b/docs/main/_modules/torch/ao/quantization/observer.html
index f807fff1aeb6..f0f17c9ba193 100644
--- a/docs/main/_modules/torch/ao/quantization/observer.html
+++ b/docs/main/_modules/torch/ao/quantization/observer.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/pt2e/export_utils.html b/docs/main/_modules/torch/ao/quantization/pt2e/export_utils.html
index 579508c37794..128a7788c0ea 100644
--- a/docs/main/_modules/torch/ao/quantization/pt2e/export_utils.html
+++ b/docs/main/_modules/torch/ao/quantization/pt2e/export_utils.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/qconfig.html b/docs/main/_modules/torch/ao/quantization/qconfig.html
index 6e7ee439ee2e..7836a4bfd8b6 100644
--- a/docs/main/_modules/torch/ao/quantization/qconfig.html
+++ b/docs/main/_modules/torch/ao/quantization/qconfig.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html b/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html
index aa111a034038..16f9fd6dc848 100644
--- a/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html
+++ b/docs/main/_modules/torch/ao/quantization/qconfig_mapping.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/quantize.html b/docs/main/_modules/torch/ao/quantization/quantize.html
index 88c4ddea35dc..cf2b198fab55 100644
--- a/docs/main/_modules/torch/ao/quantization/quantize.html
+++ b/docs/main/_modules/torch/ao/quantization/quantize.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/quantize_fx.html b/docs/main/_modules/torch/ao/quantization/quantize_fx.html
index 3a98e7704252..572eb7f4a01b 100644
--- a/docs/main/_modules/torch/ao/quantization/quantize_fx.html
+++ b/docs/main/_modules/torch/ao/quantization/quantize_fx.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/ao/quantization/stubs.html b/docs/main/_modules/torch/ao/quantization/stubs.html
index 0cc1988c15a3..19df115bc67d 100644
--- a/docs/main/_modules/torch/ao/quantization/stubs.html
+++ b/docs/main/_modules/torch/ao/quantization/stubs.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd.html b/docs/main/_modules/torch/autograd.html
index 3817741b48f0..51f769c88075 100644
--- a/docs/main/_modules/torch/autograd.html
+++ b/docs/main/_modules/torch/autograd.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/anomaly_mode.html b/docs/main/_modules/torch/autograd/anomaly_mode.html
index d34efcbc141c..e67a22e05133 100644
--- a/docs/main/_modules/torch/autograd/anomaly_mode.html
+++ b/docs/main/_modules/torch/autograd/anomaly_mode.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/forward_ad.html b/docs/main/_modules/torch/autograd/forward_ad.html
index c2efd8fb3fee..4a8da542e819 100644
--- a/docs/main/_modules/torch/autograd/forward_ad.html
+++ b/docs/main/_modules/torch/autograd/forward_ad.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/function.html b/docs/main/_modules/torch/autograd/function.html
index 175cea103b26..feee72b30814 100644
--- a/docs/main/_modules/torch/autograd/function.html
+++ b/docs/main/_modules/torch/autograd/function.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/functional.html b/docs/main/_modules/torch/autograd/functional.html
index 6a507a877026..0a62dc33c469 100644
--- a/docs/main/_modules/torch/autograd/functional.html
+++ b/docs/main/_modules/torch/autograd/functional.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/grad_mode.html b/docs/main/_modules/torch/autograd/grad_mode.html
index 32e13d49c2db..20cbe1b99f0c 100644
--- a/docs/main/_modules/torch/autograd/grad_mode.html
+++ b/docs/main/_modules/torch/autograd/grad_mode.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/gradcheck.html b/docs/main/_modules/torch/autograd/gradcheck.html
index 17c01f610d1a..762e84d3cf81 100644
--- a/docs/main/_modules/torch/autograd/gradcheck.html
+++ b/docs/main/_modules/torch/autograd/gradcheck.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/graph.html b/docs/main/_modules/torch/autograd/graph.html
index 15924d8da4e8..74b20b4ccb1e 100644
--- a/docs/main/_modules/torch/autograd/graph.html
+++ b/docs/main/_modules/torch/autograd/graph.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/profiler.html b/docs/main/_modules/torch/autograd/profiler.html
index a896d07cde86..1d935ef9a94e 100644
--- a/docs/main/_modules/torch/autograd/profiler.html
+++ b/docs/main/_modules/torch/autograd/profiler.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/autograd/profiler_util.html b/docs/main/_modules/torch/autograd/profiler_util.html
index c96af38f75fe..67f1a034b5e3 100644
--- a/docs/main/_modules/torch/autograd/profiler_util.html
+++ b/docs/main/_modules/torch/autograd/profiler_util.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/cpu.html b/docs/main/_modules/torch/backends/cpu.html
index 009ea66b724b..cc56ab957c67 100644
--- a/docs/main/_modules/torch/backends/cpu.html
+++ b/docs/main/_modules/torch/backends/cpu.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/cuda.html b/docs/main/_modules/torch/backends/cuda.html
index 4db12ab08cbd..a9e129baa77e 100644
--- a/docs/main/_modules/torch/backends/cuda.html
+++ b/docs/main/_modules/torch/backends/cuda.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/cudnn.html b/docs/main/_modules/torch/backends/cudnn.html
index 02a7fc484183..4401de81c01e 100644
--- a/docs/main/_modules/torch/backends/cudnn.html
+++ b/docs/main/_modules/torch/backends/cudnn.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/mha.html b/docs/main/_modules/torch/backends/mha.html
index 35834ff52996..52a740c13587 100644
--- a/docs/main/_modules/torch/backends/mha.html
+++ b/docs/main/_modules/torch/backends/mha.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/mkl.html b/docs/main/_modules/torch/backends/mkl.html
index 16216cd3cf65..87f8ff2fb004 100644
--- a/docs/main/_modules/torch/backends/mkl.html
+++ b/docs/main/_modules/torch/backends/mkl.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/mkldnn.html b/docs/main/_modules/torch/backends/mkldnn.html
index bcf3bdd59bea..22fc5d0ab181 100644
--- a/docs/main/_modules/torch/backends/mkldnn.html
+++ b/docs/main/_modules/torch/backends/mkldnn.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/mps.html b/docs/main/_modules/torch/backends/mps.html
index 389629484750..d113bde79860 100644
--- a/docs/main/_modules/torch/backends/mps.html
+++ b/docs/main/_modules/torch/backends/mps.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/nnpack.html b/docs/main/_modules/torch/backends/nnpack.html
index 6551523ef244..6163e640dc59 100644
--- a/docs/main/_modules/torch/backends/nnpack.html
+++ b/docs/main/_modules/torch/backends/nnpack.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/openmp.html b/docs/main/_modules/torch/backends/openmp.html
index 9c1725d24eb9..e26b7b6e6843 100644
--- a/docs/main/_modules/torch/backends/openmp.html
+++ b/docs/main/_modules/torch/backends/openmp.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/backends/opt_einsum.html b/docs/main/_modules/torch/backends/opt_einsum.html
index 84d3dea2efb7..83d99edc8aa0 100644
--- a/docs/main/_modules/torch/backends/opt_einsum.html
+++ b/docs/main/_modules/torch/backends/opt_einsum.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/compiler.html b/docs/main/_modules/torch/compiler.html
index 4badf7b964c7..a02678b65824 100644
--- a/docs/main/_modules/torch/compiler.html
+++ b/docs/main/_modules/torch/compiler.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cpu.html b/docs/main/_modules/torch/cpu.html
index c8ea047cc796..5a15ba9d7c25 100644
--- a/docs/main/_modules/torch/cpu.html
+++ b/docs/main/_modules/torch/cpu.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cpu/amp/autocast_mode.html b/docs/main/_modules/torch/cpu/amp/autocast_mode.html
index d9233c390ce4..d4c4eba95d66 100644
--- a/docs/main/_modules/torch/cpu/amp/autocast_mode.html
+++ b/docs/main/_modules/torch/cpu/amp/autocast_mode.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda.html b/docs/main/_modules/torch/cuda.html
index b5142bab4638..8258281e1c7f 100644
--- a/docs/main/_modules/torch/cuda.html
+++ b/docs/main/_modules/torch/cuda.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/_sanitizer.html b/docs/main/_modules/torch/cuda/_sanitizer.html
index 433ddc7d66d9..351ceb4ea084 100644
--- a/docs/main/_modules/torch/cuda/_sanitizer.html
+++ b/docs/main/_modules/torch/cuda/_sanitizer.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/amp/autocast_mode.html b/docs/main/_modules/torch/cuda/amp/autocast_mode.html
index c44da641afcf..bb9ffccd8eaa 100644
--- a/docs/main/_modules/torch/cuda/amp/autocast_mode.html
+++ b/docs/main/_modules/torch/cuda/amp/autocast_mode.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/amp/grad_scaler.html b/docs/main/_modules/torch/cuda/amp/grad_scaler.html
index 7dfd0ce33c7b..f5205cdce37c 100644
--- a/docs/main/_modules/torch/cuda/amp/grad_scaler.html
+++ b/docs/main/_modules/torch/cuda/amp/grad_scaler.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/graphs.html b/docs/main/_modules/torch/cuda/graphs.html
index 0df8b8b47f15..adb6b3e40ac8 100644
--- a/docs/main/_modules/torch/cuda/graphs.html
+++ b/docs/main/_modules/torch/cuda/graphs.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/jiterator.html b/docs/main/_modules/torch/cuda/jiterator.html
index c2a9256409c6..e3ad27a671a0 100644
--- a/docs/main/_modules/torch/cuda/jiterator.html
+++ b/docs/main/_modules/torch/cuda/jiterator.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/memory.html b/docs/main/_modules/torch/cuda/memory.html
index 10ce966f9451..b940f5823ecf 100644
--- a/docs/main/_modules/torch/cuda/memory.html
+++ b/docs/main/_modules/torch/cuda/memory.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/nvtx.html b/docs/main/_modules/torch/cuda/nvtx.html
index e6d4f5dc61e5..a4adee89fdff 100644
--- a/docs/main/_modules/torch/cuda/nvtx.html
+++ b/docs/main/_modules/torch/cuda/nvtx.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/random.html b/docs/main/_modules/torch/cuda/random.html
index 9efad70db448..22871a499610 100644
--- a/docs/main/_modules/torch/cuda/random.html
+++ b/docs/main/_modules/torch/cuda/random.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/cuda/streams.html b/docs/main/_modules/torch/cuda/streams.html
index e0defd0d8dda..915b678d0167 100644
--- a/docs/main/_modules/torch/cuda/streams.html
+++ b/docs/main/_modules/torch/cuda/streams.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed.html b/docs/main/_modules/torch/distributed.html
index 86f0d7843955..a9cf86b5ee6d 100644
--- a/docs/main/_modules/torch/distributed.html
+++ b/docs/main/_modules/torch/distributed.html
@@ -242,7 +242,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 a560ba6d17c9..1b6c61727f44 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
@@ -242,7 +242,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 ee6ba408867b..ae79e14fd1ce 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
@@ -242,7 +242,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 7ce894f0f057..e053feff794a 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
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/algorithms/join.html b/docs/main/_modules/torch/distributed/algorithms/join.html
index be896b837fb0..dd9af835f838 100644
--- a/docs/main/_modules/torch/distributed/algorithms/join.html
+++ b/docs/main/_modules/torch/distributed/algorithms/join.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/autograd.html b/docs/main/_modules/torch/distributed/autograd.html
index 37c1731009b2..2877b8df1de2 100644
--- a/docs/main/_modules/torch/distributed/autograd.html
+++ b/docs/main/_modules/torch/distributed/autograd.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/default_planner.html b/docs/main/_modules/torch/distributed/checkpoint/default_planner.html
index ee0f1a332100..664d35354aff 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/default_planner.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/default_planner.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/filesystem.html b/docs/main/_modules/torch/distributed/checkpoint/filesystem.html
index e97034a8b5ab..f41eca2f1adf 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/filesystem.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/filesystem.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/format_utils.html b/docs/main/_modules/torch/distributed/checkpoint/format_utils.html
index 0d34715be020..c827fdbdc71e 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/format_utils.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/format_utils.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/planner.html b/docs/main/_modules/torch/distributed/checkpoint/planner.html
index b63fa8cfba46..0381b2f0e6df 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/planner.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/planner.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/state_dict.html b/docs/main/_modules/torch/distributed/checkpoint/state_dict.html
index 206266923557..d4f1260fca70 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/state_dict.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/state_dict.html
@@ -242,7 +242,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 b63e71d3750e..55d796da3949 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/state_dict_loader.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/state_dict_loader.html
@@ -242,7 +242,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 11c20205c4ce..21dc08bfa57d 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/state_dict_saver.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/state_dict_saver.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/stateful.html b/docs/main/_modules/torch/distributed/checkpoint/stateful.html
index 3f98a58ecb3b..2a33769740a2 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/stateful.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/stateful.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/checkpoint/storage.html b/docs/main/_modules/torch/distributed/checkpoint/storage.html
index 85d140a0764a..c819895d2a44 100644
--- a/docs/main/_modules/torch/distributed/checkpoint/storage.html
+++ b/docs/main/_modules/torch/distributed/checkpoint/storage.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/device_mesh.html b/docs/main/_modules/torch/distributed/device_mesh.html
index 8a2e8a8dbefa..af6738044bcd 100644
--- a/docs/main/_modules/torch/distributed/device_mesh.html
+++ b/docs/main/_modules/torch/distributed/device_mesh.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/distributed_c10d.html b/docs/main/_modules/torch/distributed/distributed_c10d.html
index 4bef30a254d4..3a2da5ef72ef 100644
--- a/docs/main/_modules/torch/distributed/distributed_c10d.html
+++ b/docs/main/_modules/torch/distributed/distributed_c10d.html
@@ -242,7 +242,7 @@
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 38e714705052..e5feafc48225 100644
--- a/docs/main/_modules/torch/distributed/elastic/agent/server/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/agent/server/api.html
@@ -242,7 +242,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 f1f46559b6b6..a1432ec50f7f 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
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/events.html b/docs/main/_modules/torch/distributed/elastic/events.html
index 80fd7bdcb6fd..fee99c903cb4 100644
--- a/docs/main/_modules/torch/distributed/elastic/events.html
+++ b/docs/main/_modules/torch/distributed/elastic/events.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/events/api.html b/docs/main/_modules/torch/distributed/elastic/events/api.html
index bed8b0350bc6..5a7ad77200d9 100644
--- a/docs/main/_modules/torch/distributed/elastic/events/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/events/api.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/events/handlers.html b/docs/main/_modules/torch/distributed/elastic/events/handlers.html
index d20113399e3d..eac60a462f5f 100644
--- a/docs/main/_modules/torch/distributed/elastic/events/handlers.html
+++ b/docs/main/_modules/torch/distributed/elastic/events/handlers.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/metrics/api.html b/docs/main/_modules/torch/distributed/elastic/metrics/api.html
index 55a937c07fea..43aa81807901 100644
--- a/docs/main/_modules/torch/distributed/elastic/metrics/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/metrics/api.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing.html
index bf5f8b0cc49e..dcf48e4f4958 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html
index e05cf970efd1..0ae1da199f0e 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/api.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html
index 3985c588a168..a9cd633dc48f 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/errors.html
@@ -242,7 +242,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 943359c51c24..50eab90aad1e 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
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/handlers.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/handlers.html
index 38e7ad695416..85f079608b6e 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/handlers.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/handlers.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/subprocess_handler.html b/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/subprocess_handler.html
index 6514c1993510..4c1de689cb16 100644
--- a/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/subprocess_handler.html
+++ b/docs/main/_modules/torch/distributed/elastic/multiprocessing/subprocess_handler/subprocess_handler.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html b/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html
index 0d082aec057c..4d4d40bae6fa 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/api.html
@@ -242,7 +242,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 f283982372fe..a86c31771ab5 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
@@ -242,7 +242,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 889085d8f55b..d0c135b0f808 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/dynamic_rendezvous.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/dynamic_rendezvous.html
@@ -242,7 +242,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 46ea4fa58d10..f1e2ea8e0bf7 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_rendezvous.html
@@ -242,7 +242,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 b136ebaceb4b..b6eee01ca8d1 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
@@ -242,7 +242,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 0c350d611f04..54ab8c6d23ac 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_server.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_server.html
@@ -242,7 +242,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 34bbff1ee8b7..9ffa3657a025 100644
--- a/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_store.html
+++ b/docs/main/_modules/torch/distributed/elastic/rendezvous/etcd_store.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/elastic/timer/api.html b/docs/main/_modules/torch/distributed/elastic/timer/api.html
index bcafada481d1..0caf5726716b 100644
--- a/docs/main/_modules/torch/distributed/elastic/timer/api.html
+++ b/docs/main/_modules/torch/distributed/elastic/timer/api.html
@@ -242,7 +242,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 6c9d81f6e6a4..feea2017ab44 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
@@ -242,7 +242,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 f92d3d98d513..81a362bd1dd7 100644
--- a/docs/main/_modules/torch/distributed/elastic/timer/local_timer.html
+++ b/docs/main/_modules/torch/distributed/elastic/timer/local_timer.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/fsdp/api.html b/docs/main/_modules/torch/distributed/fsdp/api.html
index e16e9444ab38..84ff2d8f19e2 100644
--- a/docs/main/_modules/torch/distributed/fsdp/api.html
+++ b/docs/main/_modules/torch/distributed/fsdp/api.html
@@ -242,7 +242,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 66945f93cdd9..8153de593aa6 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
@@ -242,7 +242,7 @@
@@ -584,7 +584,7 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
_register_flat_param,
_register_orig_params,
_unshard_params,
- _unshard_params_recurse,
+ _unshard_params_for_summon,
)
from .wrap import CustomPolicy, ModuleWrapPolicy
@@ -614,7 +614,8 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
.. _`Xu et al.`: https://arxiv.org/abs/2004.13336
.. _DeepSpeed: https://www.deepspeed.ai/
- For advanced notes please refer to :ref:`fsdp_notes`.
+ To understand FSDP internals, refer to the
+ :ref:`fsdp_notes`.
Example::
@@ -629,111 +630,91 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
>>> loss.backward()
>>> optim.step()
- .. warning::
- The optimizer must be initialized *after* the module has been wrapped
- with FSDP since FSDP will shard and transform the module's parameters
- in a way that may not preserve the original parameter variables. Thus,
- the previously initialized optimizer may have stale references to the
- parameters.
-
- .. warning::
- If the destination CUDA device has ID ``dev_id``, either (1)
- ``module`` should already be placed on that device, (2) the device
- should be set using ``torch.cuda.set_device(dev_id)``, or (3)
- ``dev_id`` should be passed into the ``device_id`` constructor
- argument. This FSDP instance's compute device will be that destination
- device. For (1) and (3), the FSDP initialization always occurs on GPU.
- For (2), the FSDP initialization happens on ``module`` 's current
- device, which may be CPU.
-
- .. warning::
- FSDP currently does not support gradient accumulation outside
- ``no_sync()`` when using CPU offloading. Trying to do so yields
- incorrect results since FSDP will use the newly-reduced gradient
- instead of accumulating with any existing gradient.
-
- .. warning::
- Changing the original parameter variable names after construction will
- lead to undefined behavior.
-
- .. warning::
- Passing in the ``sync_module_states=True`` flag requires ``module`` to
- be on GPU or to use the ``device_id`` argument to specify a CUDA device
- that FSDP will move ``module`` to in the FSDP constructor. This is
- because ``sync_module_states=True`` requires GPU communication.
-
- .. warning::
- As of PyTorch 1.12, FSDP only offers limited support for shared parameters
- (for example, setting one ``Linear`` layer's weight to another's). In
- particular, modules that share parameters must be wrapped as part of the
- same FSDP unit. If enhanced shared parameter support is needed for your
- use case, please ping https://github.com/pytorch/pytorch/issues/77724
-
- .. warning::
- FSDP has some constraints on freezing parameters (i.e. setting
- ``param.requires_grad=False``). For ``use_orig_params=False``, each
- FSDP instance must manage parameters that are all frozen or all
- non-frozen. For ``use_orig_params=True``, FSDP supports mixing frozen
- and non-frozen, but we recommend not doing so since then the gradient
- memory usage will be higher than expected (namely, equivalent to not
- freezing those parameters). This means that ideally, frozen parameters
- should be isolated into their own ``nn.Module`` s and wrapped
- separately with FSDP.
-
- .. note::
- Attempting to run the forward pass of a submodule that is contained in an
- FSDP instance is not supported and will result in errors. This is because the
- submodule's parameters will be sharded, but it itself is not an FSDP instance,
- so its forward pass will not all-gather the full parameters appropriately.
- This could potentially happen when attempting to run only the encoder of a
- encoder-decoder model, and the encoder is not wrapped in its own FSDP instance. To
- resolve this, please wrap the submodule in its own FSDP unit.
-
- .. note::
- FSDP moves input tensors to the ``forward`` method to the GPU compute
- device, so the user does not need to manually move them from CPU.
-
- .. warning::
- The user should not modify the parameters between forward and backward
- without using the :meth:`summon_full_params` context since the
- modifications may not persist. Moreover, for ``use_orig_params=False``,
- accessing the original parameters between forward and backward may
- raise an illegal memory access.
-
- .. warning::
- For ``use_orig_params=True``, ``ShardingStrategy.SHARD_GRAD_OP``
- exposes the unsharded parameters, not the sharded parameters, after
- forward since it does not free the unsharded ones, unlike
- ``ShardingStrategy.FULL_SHARD``. One caveat is that, since gradients
- are always sharded or ``None``, ``ShardingStrategy.SHARD_GRAD_OP`` will
- not expose the sharded gradients with the unsharded parameters after
- forward. If you want to inspect the gradients, try
- :meth:`summon_full_params` with ``with_grads=True``.
-
- .. warning::
- FSDP replaces managed modules' parameters with ``torch.Tensor`` views
- during forward and backward computation for autograd-related reasons.
- If your module's forward relies on saved references to the parameters
- instead of reacquiring the references each iteration, then it will not
- see FSDP's newly created views, and autograd will not work correctly.
-
- .. note::
- With ``limit_all_gathers=True``, you may see a gap in the FSDP
- pre-forward where the CPU thread is not issuing any kernels. This is
- intentional and shows the rate limiter in effect. Synchronizing the CPU
- thread in that way prevents over-allocating memory for subsequent
- all-gathers, and it should not actually delay GPU kernel execution.
-
- .. note::
- When using ``sharding_strategy=ShardingStrategy.HYBRID_SHARD`` with the
- sharding process group being intra-node and the replication process
- group being inter-node, setting ``NCCL_CROSS_NIC=1`` can help improve
- the all-reduce times over the replication process group for some
- cluster setups.
-
- .. warning::
- FSDP does not work with double backwards due to how it registers
- backward hooks.
+ Using FSDP involves wrapping your module and then initializing your
+ optimizer after. This is required since FSDP changes the parameter
+ variables.
+
+ When setting up FSDP, you need to consider the destination CUDA
+ device. If the device has an ID (``dev_id``), you have three options:
+
+ * Place the module on that device
+ * Set the device using ``torch.cuda.set_device(dev_id)``
+ * Pass ``dev_id`` into the ``device_id`` constructor argument.
+
+ This ensures that the FSDP instance's compute device is the
+ destination device. For option 1 and 3, the FSDP initialization
+ always occurs on GPU. For option 2, the FSDP initialization
+ happens on module's current device, which may be a CPU.
+
+ If you're using the ``sync_module_states=True`` flag, you need to
+ ensure that the module is on a GPU or use the ``device_id``
+ argument to specify a CUDA device that FSDP will move the module
+ to in the FSDP constructor. This is necessary because
+ ``sync_module_states=True`` requires GPU communication.
+
+ FSDP also takes care of moving input tensors to the forward method
+ to the GPU compute device, so you don't need to manually move them
+ from CPU.
+
+ For ``use_orig_params=True``,
+ ``ShardingStrategy.SHARD_GRAD_OP`` exposes the unsharded
+ parameters, not the sharded parameters after forward, unlike
+ ``ShardingStrategy.FULL_SHARD``. If you want
+ to inspect the gradients, you can use the ``summon_full_params``
+ method with ``with_grads=True``.
+
+ With ``limit_all_gathers=True``, you may see a gap in the FSDP
+ pre-forward where the CPU thread is not issuing any kernels. This is
+ intentional and shows the rate limiter in effect. Synchronizing the CPU
+ thread in that way prevents over-allocating memory for subsequent
+ all-gathers, and it should not actually delay GPU kernel execution.
+
+ FSDP replaces managed modules' parameters with ``torch.Tensor``
+ views during forward and backward computation for autograd-related
+ reasons. If your module's forward relies on saved references to
+ the parameters instead of reacquiring the references each
+ iteration, then it will not see FSDP's newly created views,
+ and autograd will not work correctly.
+
+ Finally, when using ``sharding_strategy=ShardingStrategy.HYBRID_SHARD``
+ with the sharding process group being intra-node and the
+ replication process group being inter-node, setting
+ ``NCCL_CROSS_NIC=1`` can help improve the all-reduce times over
+ the replication process group for some cluster setups.
+
+ **Limitations**
+
+ There are several limitations to be aware of when using FSDP:
+
+ * FSDP currently does not support gradient accumulation outside
+ ``no_sync()`` when using CPU offloading. This is because FSDP
+ uses the newly-reduced gradient instead of accumulating with any
+ existing gradient, which can lead to incorrect results.
+
+ * FSDP does not support running the forward pass of a submodule
+ that is contained in an FSDP instance. This is because the
+ submodule's parameters will be sharded, but the submodule itself
+ is not an FSDP instance, so its forward pass will not all-gather
+ the full parameters appropriately.
+
+ * FSDP does not work with double backwards due to the way it
+ registers backward hooks.
+
+ * FSDP has some constraints when freezing parameters.
+ For ``use_orig_params=False``, each FSDP instance must manage
+ parameters that are all frozen or all non-frozen. For
+ ``use_orig_params=True``, FSDP supports mixing frozen and
+ non-frozen parameters, but it's recommended to avoid doing so to
+ prevent higher than expected gradient memory usage.
+
+ * As of PyTorch 1.12, FSDP offers limited support for shared
+ parameters. If enhanced shared parameter support is needed for
+ your use case, please post in
+ `this issue <https://github.com/pytorch/pytorch/issues/77724>`__.
+
+ * You should avoid modifying the parameters between forward and
+ backward without using the ``summon_full_params`` context, as
+ the modifications may not persist.
Args:
module (nn.Module):
@@ -1084,14 +1065,13 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
"""
uninitialized = self._is_root is None
self._assert_state(TrainingState.IDLE)
- # Use `_unshard_params_recurse()` with `recurse=False` instead of
+ # Use `_unshard_params_for_summon()` with `recurse=False` instead of
# `_unshard_fsdp_state_params()` directly to perform lazy
# initialization, which is needed to initialize `FlatParameter`
# parameter attributes as required by the unshard logic
- with _unshard_params_recurse(
+ with _unshard_params_for_summon(
self,
self,
- recurse=False,
writeback=True,
rank0_only=False,
offload_to_cpu=False,
@@ -1099,9 +1079,9 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
):
ret = super().apply(fn)
- # Reset lazy init called in `_unshard_params_recurse()` since `apply()`
- # may have been called on FSDP instance that is not truly a root, in
- # which case it will be incorrectly marked as one.
+ # Reset lazy init called in `_unshard_params_for_summon()` since
+ # `apply()` may have been called on FSDP instance that is not truly a
+ # root, in which case it will be incorrectly marked as one.
if uninitialized and self._is_root:
for module in traversal_utils._get_fsdp_states(self):
module._reset_lazy_init()
@@ -1567,21 +1547,21 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
Returns:
Total norm of the parameters (viewed as a single vector).
- .. note:: If every FSDP instance uses ``NO_SHARD``, meaning that no
- gradients are sharded across ranks, then you may directly use
- :func:`torch.nn.utils.clip_grad_norm_`.
+ If every FSDP instance uses ``NO_SHARD``, meaning that no
+ gradients are sharded across ranks, then you may directly use
+ :func:`torch.nn.utils.clip_grad_norm_`.
- .. note:: If at least some FSDP instance uses a sharded strategy (i.e.
- one other than ``NO_SHARD``), then you should use this method
- instead of :func:`torch.nn.utils.clip_grad_norm_` since this method
- handles the fact that gradients are sharded across ranks.
+ If at least some FSDP instance uses a sharded strategy (i.e.
+ one other than ``NO_SHARD``), then you should use this method
+ instead of :func:`torch.nn.utils.clip_grad_norm_` since this method
+ handles the fact that gradients are sharded across ranks.
- .. note:: The total norm returned will have the "largest" dtype across
- all parameters/gradients as defined by PyTorch's type promotion
- semantics. For example, if *all* parameters/gradients use a low
- precision dtype, then the returned norm's dtype will be that low
- precision dtype, but if there exists at least one parameter/
- gradient using FP32, then the returned norm's dtype will be FP32.
+ The total norm returned will have the "largest" dtype across
+ all parameters/gradients as defined by PyTorch's type promotion
+ semantics. For example, if *all* parameters/gradients use a low
+ precision dtype, then the returned norm's dtype will be that low
+ precision dtype, but if there exists at least one parameter/
+ gradient using FP32, then the returned norm's dtype will be FP32.
.. warning:: This needs to be called on all ranks since it uses
collective communications.
@@ -1845,19 +1825,19 @@ Source code for torch.distributed.fsdp.fully_sharded_data_parallel
and ``"param_groups"``. The flattened parameters in ``FSDP`` modules
contained in ``model`` are mapped back to their unflattened parameters.
- .. warning:: This needs to be called on all ranks since it uses
- collective communications. However, if ``rank0_only=True``, then
- the state dict is only populated on rank 0, and all other ranks
- return an empty :class:`dict`.
-
- .. warning:: Unlike ``torch.optim.Optimizer.state_dict()``, this method
- uses full parameter names as keys instead of parameter IDs.
-
- .. note:: Like in :meth:`torch.optim.Optimizer.state_dict`, the tensors
- contained in the optimizer state dict are not cloned, so there may
- be aliasing surprises. For best practices, consider saving the
- returned optimizer state dict immediately, e.g. using
- ``torch.save()``.
+ This needs to be called on all ranks since it uses
+ collective communications. However, if ``rank0_only=True``, then
+ the state dict is only populated on rank 0, and all other ranks
+ return an empty :class:`dict`.
+
+ Unlike ``torch.optim.Optimizer.state_dict()``, this method
+ uses full parameter names as keys instead of parameter IDs.
+
+ Like in :meth:`torch.optim.Optimizer.state_dict`, the tensors
+ contained in the optimizer state dict are not cloned, so there may
+ be aliasing surprises. For best practices, consider saving the
+ returned optimizer state dict immediately, e.g. using
+ ``torch.save()``.
Args:
model (torch.nn.Module): Root module (which may or may not be a
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 b4c3c110ee04..8a8e23c0877e 100644
--- a/docs/main/_modules/torch/distributed/nn/api/remote_module.html
+++ b/docs/main/_modules/torch/distributed/nn/api/remote_module.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/optim/optimizer.html b/docs/main/_modules/torch/distributed/optim/optimizer.html
index c463eaba9136..ed4f8df85cd6 100644
--- a/docs/main/_modules/torch/distributed/optim/optimizer.html
+++ b/docs/main/_modules/torch/distributed/optim/optimizer.html
@@ -242,7 +242,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 fe3221af1188..4dd2625f785d 100644
--- a/docs/main/_modules/torch/distributed/optim/post_localSGD_optimizer.html
+++ b/docs/main/_modules/torch/distributed/optim/post_localSGD_optimizer.html
@@ -242,7 +242,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 b43cb7a9527d..019165a99ece 100644
--- a/docs/main/_modules/torch/distributed/optim/zero_redundancy_optimizer.html
+++ b/docs/main/_modules/torch/distributed/optim/zero_redundancy_optimizer.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html b/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html
index 396619b5f77c..28068153e535 100644
--- a/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html
+++ b/docs/main/_modules/torch/distributed/pipeline/sync/pipe.html
@@ -242,7 +242,7 @@
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 28ea6dd43008..06a12b6e356f 100644
--- a/docs/main/_modules/torch/distributed/pipeline/sync/skip/skippable.html
+++ b/docs/main/_modules/torch/distributed/pipeline/sync/skip/skippable.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc.html b/docs/main/_modules/torch/distributed/rpc.html
index 1daa12ef1b3c..3176455ed84d 100644
--- a/docs/main/_modules/torch/distributed/rpc.html
+++ b/docs/main/_modules/torch/distributed/rpc.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/api.html b/docs/main/_modules/torch/distributed/rpc/api.html
index d93c4b97e219..20f7453be406 100644
--- a/docs/main/_modules/torch/distributed/rpc/api.html
+++ b/docs/main/_modules/torch/distributed/rpc/api.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/backend_registry.html b/docs/main/_modules/torch/distributed/rpc/backend_registry.html
index 694fe6435a32..0360d1b89a9e 100644
--- a/docs/main/_modules/torch/distributed/rpc/backend_registry.html
+++ b/docs/main/_modules/torch/distributed/rpc/backend_registry.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/functions.html b/docs/main/_modules/torch/distributed/rpc/functions.html
index 67fb3b93fa54..fddd8f8a1477 100644
--- a/docs/main/_modules/torch/distributed/rpc/functions.html
+++ b/docs/main/_modules/torch/distributed/rpc/functions.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/rpc/options.html b/docs/main/_modules/torch/distributed/rpc/options.html
index ea9d8a6f42e4..d3ef92227c14 100644
--- a/docs/main/_modules/torch/distributed/rpc/options.html
+++ b/docs/main/_modules/torch/distributed/rpc/options.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/api.html b/docs/main/_modules/torch/distributed/tensor/parallel/api.html
index 07ea4d86d43f..edd6cd03b0b0 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/api.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/api.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/loss.html b/docs/main/_modules/torch/distributed/tensor/parallel/loss.html
index ca1cd8cffa4d..0f0883700ca9 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/loss.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/loss.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributed/tensor/parallel/style.html b/docs/main/_modules/torch/distributed/tensor/parallel/style.html
index 038730835afc..5a66ae315f1e 100644
--- a/docs/main/_modules/torch/distributed/tensor/parallel/style.html
+++ b/docs/main/_modules/torch/distributed/tensor/parallel/style.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/bernoulli.html b/docs/main/_modules/torch/distributions/bernoulli.html
index ea6401fb257f..7a2227c4d98b 100644
--- a/docs/main/_modules/torch/distributions/bernoulli.html
+++ b/docs/main/_modules/torch/distributions/bernoulli.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/beta.html b/docs/main/_modules/torch/distributions/beta.html
index 8ba0f1a2a159..810f9daa5a25 100644
--- a/docs/main/_modules/torch/distributions/beta.html
+++ b/docs/main/_modules/torch/distributions/beta.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/binomial.html b/docs/main/_modules/torch/distributions/binomial.html
index eabd56fa1cba..300db67bb59e 100644
--- a/docs/main/_modules/torch/distributions/binomial.html
+++ b/docs/main/_modules/torch/distributions/binomial.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/categorical.html b/docs/main/_modules/torch/distributions/categorical.html
index ed24b5d6120f..978ddfcbae15 100644
--- a/docs/main/_modules/torch/distributions/categorical.html
+++ b/docs/main/_modules/torch/distributions/categorical.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/cauchy.html b/docs/main/_modules/torch/distributions/cauchy.html
index 4a2fe22aa0b6..0da7ccba0c85 100644
--- a/docs/main/_modules/torch/distributions/cauchy.html
+++ b/docs/main/_modules/torch/distributions/cauchy.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/chi2.html b/docs/main/_modules/torch/distributions/chi2.html
index e19704e0e3ed..468de76a2b2d 100644
--- a/docs/main/_modules/torch/distributions/chi2.html
+++ b/docs/main/_modules/torch/distributions/chi2.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/constraint_registry.html b/docs/main/_modules/torch/distributions/constraint_registry.html
index a341f8a6863c..b67399fad33b 100644
--- a/docs/main/_modules/torch/distributions/constraint_registry.html
+++ b/docs/main/_modules/torch/distributions/constraint_registry.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/constraints.html b/docs/main/_modules/torch/distributions/constraints.html
index 0acfcc6a7405..468e8b098455 100644
--- a/docs/main/_modules/torch/distributions/constraints.html
+++ b/docs/main/_modules/torch/distributions/constraints.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/continuous_bernoulli.html b/docs/main/_modules/torch/distributions/continuous_bernoulli.html
index ade4cebef05c..f67c8d50de26 100644
--- a/docs/main/_modules/torch/distributions/continuous_bernoulli.html
+++ b/docs/main/_modules/torch/distributions/continuous_bernoulli.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/dirichlet.html b/docs/main/_modules/torch/distributions/dirichlet.html
index 94ad55aaa59b..a41b94f959f8 100644
--- a/docs/main/_modules/torch/distributions/dirichlet.html
+++ b/docs/main/_modules/torch/distributions/dirichlet.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/distribution.html b/docs/main/_modules/torch/distributions/distribution.html
index 349b3bd65eee..e067a196f4bb 100644
--- a/docs/main/_modules/torch/distributions/distribution.html
+++ b/docs/main/_modules/torch/distributions/distribution.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/exp_family.html b/docs/main/_modules/torch/distributions/exp_family.html
index 79020f05b17d..09b4b33ec787 100644
--- a/docs/main/_modules/torch/distributions/exp_family.html
+++ b/docs/main/_modules/torch/distributions/exp_family.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/exponential.html b/docs/main/_modules/torch/distributions/exponential.html
index 6ba8d6d049c9..12efc3b5761e 100644
--- a/docs/main/_modules/torch/distributions/exponential.html
+++ b/docs/main/_modules/torch/distributions/exponential.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/fishersnedecor.html b/docs/main/_modules/torch/distributions/fishersnedecor.html
index 2cbda94b4a3b..798742781dce 100644
--- a/docs/main/_modules/torch/distributions/fishersnedecor.html
+++ b/docs/main/_modules/torch/distributions/fishersnedecor.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/gamma.html b/docs/main/_modules/torch/distributions/gamma.html
index da353894a63d..4a9cdd073268 100644
--- a/docs/main/_modules/torch/distributions/gamma.html
+++ b/docs/main/_modules/torch/distributions/gamma.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/geometric.html b/docs/main/_modules/torch/distributions/geometric.html
index e599b05eae6f..5c13747a31c7 100644
--- a/docs/main/_modules/torch/distributions/geometric.html
+++ b/docs/main/_modules/torch/distributions/geometric.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/gumbel.html b/docs/main/_modules/torch/distributions/gumbel.html
index 692e40ea13bf..8bfc898e4773 100644
--- a/docs/main/_modules/torch/distributions/gumbel.html
+++ b/docs/main/_modules/torch/distributions/gumbel.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/half_cauchy.html b/docs/main/_modules/torch/distributions/half_cauchy.html
index f2fb20a785ad..412a9426dd6d 100644
--- a/docs/main/_modules/torch/distributions/half_cauchy.html
+++ b/docs/main/_modules/torch/distributions/half_cauchy.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/half_normal.html b/docs/main/_modules/torch/distributions/half_normal.html
index d16a2e4e804c..fd8797b51cb1 100644
--- a/docs/main/_modules/torch/distributions/half_normal.html
+++ b/docs/main/_modules/torch/distributions/half_normal.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/independent.html b/docs/main/_modules/torch/distributions/independent.html
index 376bc091cdb3..c1c8a9a39b96 100644
--- a/docs/main/_modules/torch/distributions/independent.html
+++ b/docs/main/_modules/torch/distributions/independent.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/inverse_gamma.html b/docs/main/_modules/torch/distributions/inverse_gamma.html
index e81c3217c891..9e117a15447a 100644
--- a/docs/main/_modules/torch/distributions/inverse_gamma.html
+++ b/docs/main/_modules/torch/distributions/inverse_gamma.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/kl.html b/docs/main/_modules/torch/distributions/kl.html
index a59660ed5521..58712b44686e 100644
--- a/docs/main/_modules/torch/distributions/kl.html
+++ b/docs/main/_modules/torch/distributions/kl.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/kumaraswamy.html b/docs/main/_modules/torch/distributions/kumaraswamy.html
index ca5fff4f8a82..83b1ea15a74c 100644
--- a/docs/main/_modules/torch/distributions/kumaraswamy.html
+++ b/docs/main/_modules/torch/distributions/kumaraswamy.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/laplace.html b/docs/main/_modules/torch/distributions/laplace.html
index b271243e5fee..cdd22adae1a6 100644
--- a/docs/main/_modules/torch/distributions/laplace.html
+++ b/docs/main/_modules/torch/distributions/laplace.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/lkj_cholesky.html b/docs/main/_modules/torch/distributions/lkj_cholesky.html
index 0acd0810a829..28675e505c64 100644
--- a/docs/main/_modules/torch/distributions/lkj_cholesky.html
+++ b/docs/main/_modules/torch/distributions/lkj_cholesky.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/log_normal.html b/docs/main/_modules/torch/distributions/log_normal.html
index 682da002ef39..4f2044fa3476 100644
--- a/docs/main/_modules/torch/distributions/log_normal.html
+++ b/docs/main/_modules/torch/distributions/log_normal.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html b/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html
index 9c45861c3b19..1be2fc3dbdaa 100644
--- a/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html
+++ b/docs/main/_modules/torch/distributions/lowrank_multivariate_normal.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/mixture_same_family.html b/docs/main/_modules/torch/distributions/mixture_same_family.html
index abe8e904f2f1..360978c8174f 100644
--- a/docs/main/_modules/torch/distributions/mixture_same_family.html
+++ b/docs/main/_modules/torch/distributions/mixture_same_family.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/multinomial.html b/docs/main/_modules/torch/distributions/multinomial.html
index c36c4c28f6dd..c7001e67698a 100644
--- a/docs/main/_modules/torch/distributions/multinomial.html
+++ b/docs/main/_modules/torch/distributions/multinomial.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/multivariate_normal.html b/docs/main/_modules/torch/distributions/multivariate_normal.html
index f7af5a3f7b70..17757d279e55 100644
--- a/docs/main/_modules/torch/distributions/multivariate_normal.html
+++ b/docs/main/_modules/torch/distributions/multivariate_normal.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/negative_binomial.html b/docs/main/_modules/torch/distributions/negative_binomial.html
index 7b09134bc18c..53baa3acea56 100644
--- a/docs/main/_modules/torch/distributions/negative_binomial.html
+++ b/docs/main/_modules/torch/distributions/negative_binomial.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/normal.html b/docs/main/_modules/torch/distributions/normal.html
index 5f8f609f47a6..7c2721b541df 100644
--- a/docs/main/_modules/torch/distributions/normal.html
+++ b/docs/main/_modules/torch/distributions/normal.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/one_hot_categorical.html b/docs/main/_modules/torch/distributions/one_hot_categorical.html
index 5b99fc23068a..62794b4dd895 100644
--- a/docs/main/_modules/torch/distributions/one_hot_categorical.html
+++ b/docs/main/_modules/torch/distributions/one_hot_categorical.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/pareto.html b/docs/main/_modules/torch/distributions/pareto.html
index 178cf0d8c939..7f32f112dfb9 100644
--- a/docs/main/_modules/torch/distributions/pareto.html
+++ b/docs/main/_modules/torch/distributions/pareto.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/poisson.html b/docs/main/_modules/torch/distributions/poisson.html
index b99587f0cdef..7795881cc5f6 100644
--- a/docs/main/_modules/torch/distributions/poisson.html
+++ b/docs/main/_modules/torch/distributions/poisson.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/relaxed_bernoulli.html b/docs/main/_modules/torch/distributions/relaxed_bernoulli.html
index cc5b3755ee73..95299ee6ba08 100644
--- a/docs/main/_modules/torch/distributions/relaxed_bernoulli.html
+++ b/docs/main/_modules/torch/distributions/relaxed_bernoulli.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/relaxed_categorical.html b/docs/main/_modules/torch/distributions/relaxed_categorical.html
index f62681dc9f77..7d2d26ce5e20 100644
--- a/docs/main/_modules/torch/distributions/relaxed_categorical.html
+++ b/docs/main/_modules/torch/distributions/relaxed_categorical.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/studentT.html b/docs/main/_modules/torch/distributions/studentT.html
index 7cfad0ba9b5f..a0cd3e53af75 100644
--- a/docs/main/_modules/torch/distributions/studentT.html
+++ b/docs/main/_modules/torch/distributions/studentT.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/transformed_distribution.html b/docs/main/_modules/torch/distributions/transformed_distribution.html
index 638c1ddd64e4..7423bcb725c2 100644
--- a/docs/main/_modules/torch/distributions/transformed_distribution.html
+++ b/docs/main/_modules/torch/distributions/transformed_distribution.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/transforms.html b/docs/main/_modules/torch/distributions/transforms.html
index 7c7303b945a1..432046ff7abb 100644
--- a/docs/main/_modules/torch/distributions/transforms.html
+++ b/docs/main/_modules/torch/distributions/transforms.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/uniform.html b/docs/main/_modules/torch/distributions/uniform.html
index 1f8081513f2d..8879d501acae 100644
--- a/docs/main/_modules/torch/distributions/uniform.html
+++ b/docs/main/_modules/torch/distributions/uniform.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/utils.html b/docs/main/_modules/torch/distributions/utils.html
index ab6af42c1e1b..646de94a86cf 100644
--- a/docs/main/_modules/torch/distributions/utils.html
+++ b/docs/main/_modules/torch/distributions/utils.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/von_mises.html b/docs/main/_modules/torch/distributions/von_mises.html
index e721ad97ae27..58e8c2c72e54 100644
--- a/docs/main/_modules/torch/distributions/von_mises.html
+++ b/docs/main/_modules/torch/distributions/von_mises.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/weibull.html b/docs/main/_modules/torch/distributions/weibull.html
index 9fc6c249ac5d..da210da24f93 100644
--- a/docs/main/_modules/torch/distributions/weibull.html
+++ b/docs/main/_modules/torch/distributions/weibull.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/distributions/wishart.html b/docs/main/_modules/torch/distributions/wishart.html
index c9bc712d89ce..5ddbb4f7af30 100644
--- a/docs/main/_modules/torch/distributions/wishart.html
+++ b/docs/main/_modules/torch/distributions/wishart.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/export.html b/docs/main/_modules/torch/export.html
index 89b3e8f958bb..a632193450d0 100644
--- a/docs/main/_modules/torch/export.html
+++ b/docs/main/_modules/torch/export.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/export/dynamic_shapes.html b/docs/main/_modules/torch/export/dynamic_shapes.html
index 3f041f419ce8..525766d8864b 100644
--- a/docs/main/_modules/torch/export/dynamic_shapes.html
+++ b/docs/main/_modules/torch/export/dynamic_shapes.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/export/exported_program.html b/docs/main/_modules/torch/export/exported_program.html
index cdab2419281c..c263c973fca8 100644
--- a/docs/main/_modules/torch/export/exported_program.html
+++ b/docs/main/_modules/torch/export/exported_program.html
@@ -242,7 +242,7 @@
@@ -961,9 +961,15 @@ Source code for torch.export.exported_program
for name in buffers_to_remove:
delattr(self.graph_module, name)
# TODO(zhxhchen17) Return the new graph_signature directly.
- gm, graph_signature = aot_export_module(
- self.graph_module, fake_args, decompositions=decomp_table, trace_joint=False
- )
+ from torch.export._trace import _ignore_backend_decomps
+
+ with _ignore_backend_decomps():
+ gm, graph_signature = aot_export_module(
+ self.graph_module,
+ fake_args,
+ decompositions=decomp_table,
+ trace_joint=False,
+ )
# Update the signatures with the new placeholder names in case they
# changed when calling aot_export
@@ -1059,7 +1065,12 @@ Source code for torch.export.exported_program
def _transform_do_not_use(self, *passes: PassType) -> "ExportedProgram":
pm = PassManager(list(passes))
- res = pm(self.graph_module)
+ # Since we abstractly run the passes, we need to disable backend decomp here
+ # again.
+ from torch.export._trace import _ignore_backend_decomps
+
+ with _ignore_backend_decomps():
+ res = pm(self.graph_module)
transformed_gm = res.graph_module if res is not None else self.graph_module
assert transformed_gm is not None
diff --git a/docs/main/_modules/torch/export/graph_signature.html b/docs/main/_modules/torch/export/graph_signature.html
index d3e942c9ee8d..08be88d80932 100644
--- a/docs/main/_modules/torch/export/graph_signature.html
+++ b/docs/main/_modules/torch/export/graph_signature.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/export/unflatten.html b/docs/main/_modules/torch/export/unflatten.html
index 8f982ecad85c..4e568f6f3b04 100644
--- a/docs/main/_modules/torch/export/unflatten.html
+++ b/docs/main/_modules/torch/export/unflatten.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/func.html b/docs/main/_modules/torch/func.html
index 70fbba57aec0..9dcf28489ee1 100644
--- a/docs/main/_modules/torch/func.html
+++ b/docs/main/_modules/torch/func.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/functional.html b/docs/main/_modules/torch/functional.html
index 936bad2ab416..afce638fe5ae 100644
--- a/docs/main/_modules/torch/functional.html
+++ b/docs/main/_modules/torch/functional.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/futures.html b/docs/main/_modules/torch/futures.html
index 90651954498b..0c139af0bd0b 100644
--- a/docs/main/_modules/torch/futures.html
+++ b/docs/main/_modules/torch/futures.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/_symbolic_trace.html b/docs/main/_modules/torch/fx/_symbolic_trace.html
index 5332bd7e9c1c..bb61d4409f92 100644
--- a/docs/main/_modules/torch/fx/_symbolic_trace.html
+++ b/docs/main/_modules/torch/fx/_symbolic_trace.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/experimental/symbolic_shapes.html b/docs/main/_modules/torch/fx/experimental/symbolic_shapes.html
index 088d1e657ffa..db68255cc0c5 100644
--- a/docs/main/_modules/torch/fx/experimental/symbolic_shapes.html
+++ b/docs/main/_modules/torch/fx/experimental/symbolic_shapes.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/graph.html b/docs/main/_modules/torch/fx/graph.html
index 50f80e114754..d47fcd4cf372 100644
--- a/docs/main/_modules/torch/fx/graph.html
+++ b/docs/main/_modules/torch/fx/graph.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/graph_module.html b/docs/main/_modules/torch/fx/graph_module.html
index be36b19be6d7..7a94f039c90c 100644
--- a/docs/main/_modules/torch/fx/graph_module.html
+++ b/docs/main/_modules/torch/fx/graph_module.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/interpreter.html b/docs/main/_modules/torch/fx/interpreter.html
index b79814a7ecab..f802db107350 100644
--- a/docs/main/_modules/torch/fx/interpreter.html
+++ b/docs/main/_modules/torch/fx/interpreter.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/node.html b/docs/main/_modules/torch/fx/node.html
index f6f8372fdc28..9942b2a0a965 100644
--- a/docs/main/_modules/torch/fx/node.html
+++ b/docs/main/_modules/torch/fx/node.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/proxy.html b/docs/main/_modules/torch/fx/proxy.html
index ecd75d96e14b..a3dccd1d053a 100644
--- a/docs/main/_modules/torch/fx/proxy.html
+++ b/docs/main/_modules/torch/fx/proxy.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/fx/subgraph_rewriter.html b/docs/main/_modules/torch/fx/subgraph_rewriter.html
index 5358495befc8..8aa403048291 100644
--- a/docs/main/_modules/torch/fx/subgraph_rewriter.html
+++ b/docs/main/_modules/torch/fx/subgraph_rewriter.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/hub.html b/docs/main/_modules/torch/hub.html
index 374896a0522a..54456a6a7479 100644
--- a/docs/main/_modules/torch/hub.html
+++ b/docs/main/_modules/torch/hub.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit.html b/docs/main/_modules/torch/jit.html
index 0879d4d60c96..612f11bc45d8 100644
--- a/docs/main/_modules/torch/jit.html
+++ b/docs/main/_modules/torch/jit.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit/_async.html b/docs/main/_modules/torch/jit/_async.html
index bc818fc37d52..e8733f335869 100644
--- a/docs/main/_modules/torch/jit/_async.html
+++ b/docs/main/_modules/torch/jit/_async.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit/_freeze.html b/docs/main/_modules/torch/jit/_freeze.html
index 0a9739a0b8f6..77e2ffb73ef3 100644
--- a/docs/main/_modules/torch/jit/_freeze.html
+++ b/docs/main/_modules/torch/jit/_freeze.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit/_fuser.html b/docs/main/_modules/torch/jit/_fuser.html
index 2fb17b94830e..99d6560af858 100644
--- a/docs/main/_modules/torch/jit/_fuser.html
+++ b/docs/main/_modules/torch/jit/_fuser.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit/_script.html b/docs/main/_modules/torch/jit/_script.html
index 7566d89c99a1..faab27ebd13f 100644
--- a/docs/main/_modules/torch/jit/_script.html
+++ b/docs/main/_modules/torch/jit/_script.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit/_serialization.html b/docs/main/_modules/torch/jit/_serialization.html
index c4d91ef302a2..0d8e1195af4f 100644
--- a/docs/main/_modules/torch/jit/_serialization.html
+++ b/docs/main/_modules/torch/jit/_serialization.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/jit/_trace.html b/docs/main/_modules/torch/jit/_trace.html
index 3ed3d410ebd8..fb009b50188f 100644
--- a/docs/main/_modules/torch/jit/_trace.html
+++ b/docs/main/_modules/torch/jit/_trace.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/library.html b/docs/main/_modules/torch/library.html
index b8087d36a830..8d842c76ba80 100644
--- a/docs/main/_modules/torch/library.html
+++ b/docs/main/_modules/torch/library.html
@@ -242,7 +242,7 @@
@@ -490,6 +490,8 @@ Source code for torch.library
import re
import contextlib
import sys
+from torch._library.custom_ops import custom_op
+
__all__ = [
'Library',
@@ -498,6 +500,7 @@ Source code for torch.library
'fallthrough_kernel',
'impl_abstract',
'get_ctx',
+ 'custom_op',
]
# Set containing the combination of (namespace, operator, DispatchKey) for which a new kernel has been registered
@@ -575,8 +578,7 @@ Source code for torch.library
name of the operator as inferred from the schema.
Example::
- >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_LIBRARY)
- >>> my_lib = Library("foo", "DEF")
+ >>> my_lib = Library("mylib", "DEF")
>>> my_lib.define("sum(Tensor self) -> Tensor")
'''
# This is added because we also want to disallow PURE_FUNCTION alias analysis which is a valid
@@ -660,6 +662,8 @@ Source code for torch.library
for handle in self._registration_handles:
handle.destroy()
self._registration_handles.clear()
+ global _impls
+ _impls -= self._op_impls
for name in self._op_defs:
# Delete the cached torch.ops.ns.foo if it was registered.
# Otherwise, accessing it leads to a segfault.
@@ -731,7 +735,6 @@ Source code for torch.library
torch.Tag carefully before applying it.
Example::
- >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_LIBRARY)
>>> import torch
>>> import numpy as np
>>>
@@ -739,14 +742,14 @@ Source code for torch.library
>>> torch.library.define("mylib::sin", "(Tensor x) -> Tensor")
>>>
>>> # Add implementations for the operator
- >>> @torch.library.impl("mylibrary::sin", "cpu")
+ >>> @torch.library.impl("mylib::sin", "cpu")
>>> def f(x):
>>> return torch.from_numpy(np.sin(x.numpy()))
>>>
>>> # Call the new operator from torch.ops.
>>> x = torch.randn(3)
>>> y = torch.ops.mylib.sin(x)
- >>> assert torch.allclose(y, x)
+ >>> assert torch.allclose(y, x.sin())
"""
if not isinstance(qualname, str):
@@ -799,15 +802,15 @@ Source code for torch.library
>>> import numpy as np
>>>
>>> # Define the operator
- >>> torch.library.define("mylibrary::sin", "(Tensor x) -> Tensor")
+ >>> torch.library.define("mylib::mysin", "(Tensor x) -> Tensor")
>>>
>>> # Add implementations for the cpu device
- >>> @torch.library.impl("mylibrary::sin", "cpu")
+ >>> @torch.library.impl("mylib::mysin", "cpu")
>>> def f(x):
>>> return torch.from_numpy(np.sin(x.numpy()))
>>>
>>> x = torch.randn(3)
- >>> y = torch.ops.mylibrary.sin(x)
+ >>> y = torch.ops.mylib.mysin(x)
>>> assert torch.allclose(y, x.sin())
"""
if isinstance(types, str):
@@ -895,7 +898,7 @@ Source code for torch.library
>>> "(Tensor x, Tensor weight, Tensor bias) -> Tensor")
>>>
>>> @torch.library.impl_abstract("mylib::custom_linear")
- >>> def custom_linear_abstract(x, weight):
+ >>> def custom_linear_abstract(x, weight, bias):
>>> assert x.dim() == 2
>>> assert weight.dim() == 2
>>> assert bias.dim() == 1
@@ -905,6 +908,14 @@ Source code for torch.library
>>>
>>> return (x @ weight.t()) + bias
>>>
+ >>> with torch._subclasses.fake_tensor.FakeTensorMode():
+ >>> x = torch.randn(2, 3)
+ >>> w = torch.randn(3, 3)
+ >>> b = torch.randn(3)
+ >>> y = torch.ops.mylib.custom_linear(x, w, b)
+ >>>
+ >>> assert y.shape == (2, 3)
+ >>>
>>> # Example 2: an operator with data-dependent output shape
>>> torch.library.define("mylib::custom_nonzero", "(Tensor x) -> Tensor")
>>>
@@ -925,6 +936,14 @@ Source code for torch.library
>>> x_np = x.numpy()
>>> res = np.stack(np.nonzero(x_np), axis=1)
>>> return torch.tensor(res, device=x.device)
+ >>>
+ >>> from torch.fx.experimental.proxy_tensor import make_fx
+ >>>
+ >>> x = torch.tensor([0, 1, 2, 3, 4, 0])
+ >>> trace = make_fx(torch.ops.mylib.custom_nonzero, tracing_mode="symbolic")(x)
+ >>> trace.print_readable()
+ >>>
+ >>> assert torch.allclose(trace(x), torch.ops.mylib.custom_nonzero(x))
"""
source = torch._library.utils.get_source(_stacklevel + 1)
diff --git a/docs/main/_modules/torch/monitor.html b/docs/main/_modules/torch/monitor.html
index 4d9922d5bff7..c045d47ff9c6 100644
--- a/docs/main/_modules/torch/monitor.html
+++ b/docs/main/_modules/torch/monitor.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/mps.html b/docs/main/_modules/torch/mps.html
index 2c7332bb9936..c19c8f57ca80 100644
--- a/docs/main/_modules/torch/mps.html
+++ b/docs/main/_modules/torch/mps.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/mps/event.html b/docs/main/_modules/torch/mps/event.html
index 9f08dc98fb5c..30f5f4159dcc 100644
--- a/docs/main/_modules/torch/mps/event.html
+++ b/docs/main/_modules/torch/mps/event.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/mps/profiler.html b/docs/main/_modules/torch/mps/profiler.html
index f759abbade70..9cafa0005b1b 100644
--- a/docs/main/_modules/torch/mps/profiler.html
+++ b/docs/main/_modules/torch/mps/profiler.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/multiprocessing.html b/docs/main/_modules/torch/multiprocessing.html
index bc52275d3cf8..509c0e0d1b5f 100644
--- a/docs/main/_modules/torch/multiprocessing.html
+++ b/docs/main/_modules/torch/multiprocessing.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/multiprocessing/spawn.html b/docs/main/_modules/torch/multiprocessing/spawn.html
index e71bcf69b9c3..d09edb1c3494 100644
--- a/docs/main/_modules/torch/multiprocessing/spawn.html
+++ b/docs/main/_modules/torch/multiprocessing/spawn.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/nested.html b/docs/main/_modules/torch/nested.html
index 39670b3da63e..495fda0297ba 100644
--- a/docs/main/_modules/torch/nested.html
+++ b/docs/main/_modules/torch/nested.html
@@ -242,7 +242,7 @@
diff --git a/docs/main/_modules/torch/nn/attention.html b/docs/main/_modules/torch/nn/attention.html
index 793e20ac1491..e6f4b4a665c1 100644
--- a/docs/main/_modules/torch/nn/attention.html
+++ b/docs/main/_modules/torch/nn/attention.html
@@ -242,7 +242,7 @@
-