diff --git a/main/_images/RReLU.png b/main/_images/RReLU.png index 9fa1edb344..97f8af241d 100644 Binary files a/main/_images/RReLU.png and b/main/_images/RReLU.png differ diff --git a/main/_modules/index.html b/main/_modules/index.html index d6aee771df..c64bb0295b 100644 --- a/main/_modules/index.html +++ b/main/_modules/index.html @@ -280,7 +280,7 @@
TensorArgument,
)
from torch.fx._symbolic_trace import is_fx_tracing
-from torch.fx.experimental.proxy_tensor import py_sym_types
from torch.utils._pytree import GetAttrKey, SequenceKey
from ._remove_effect_tokens_pass import _remove_effect_tokens
@@ -1327,7 +1326,6 @@ Source code for torch.export.unflatten
# To avoid this we copy these call_function nodes with sym_type results.
# This should however only be done for sym_type nodes - call_function nodes on tensors
# should not be deduplicated in the first place.
- assert isinstance(x.meta["val"], py_sym_types)
args = tuple(
self.remap_input(_x) if isinstance(_x, torch.fx.Node) else _x
for _x in x.args
diff --git a/main/_modules/torch/func.html b/main/_modules/torch/func.html
index cbf5bab14d..99d41a0c84 100644
--- a/main/_modules/torch/func.html
+++ b/main/_modules/torch/func.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/functional.html b/main/_modules/torch/functional.html
index d9f698e72c..183cf0b842 100644
--- a/main/_modules/torch/functional.html
+++ b/main/_modules/torch/functional.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/futures.html b/main/_modules/torch/futures.html
index f2988da0f2..859ec1b6e0 100644
--- a/main/_modules/torch/futures.html
+++ b/main/_modules/torch/futures.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/_symbolic_trace.html b/main/_modules/torch/fx/_symbolic_trace.html
index c9ed789de9..5619ac9bc9 100644
--- a/main/_modules/torch/fx/_symbolic_trace.html
+++ b/main/_modules/torch/fx/_symbolic_trace.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/experimental/symbolic_shapes.html b/main/_modules/torch/fx/experimental/symbolic_shapes.html
index 623ad65c8f..183f85368b 100644
--- a/main/_modules/torch/fx/experimental/symbolic_shapes.html
+++ b/main/_modules/torch/fx/experimental/symbolic_shapes.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/graph.html b/main/_modules/torch/fx/graph.html
index 25cc9e97e8..25021e2f0d 100644
--- a/main/_modules/torch/fx/graph.html
+++ b/main/_modules/torch/fx/graph.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/graph_module.html b/main/_modules/torch/fx/graph_module.html
index 3b7a04c861..ba6171d576 100644
--- a/main/_modules/torch/fx/graph_module.html
+++ b/main/_modules/torch/fx/graph_module.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/interpreter.html b/main/_modules/torch/fx/interpreter.html
index 0c06990170..fbbeff3060 100644
--- a/main/_modules/torch/fx/interpreter.html
+++ b/main/_modules/torch/fx/interpreter.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/node.html b/main/_modules/torch/fx/node.html
index 7fb7962c71..e32941a929 100644
--- a/main/_modules/torch/fx/node.html
+++ b/main/_modules/torch/fx/node.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/proxy.html b/main/_modules/torch/fx/proxy.html
index 929f04f4c8..bff3cd7d9b 100644
--- a/main/_modules/torch/fx/proxy.html
+++ b/main/_modules/torch/fx/proxy.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/fx/subgraph_rewriter.html b/main/_modules/torch/fx/subgraph_rewriter.html
index 862ac01c40..79e4917757 100644
--- a/main/_modules/torch/fx/subgraph_rewriter.html
+++ b/main/_modules/torch/fx/subgraph_rewriter.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/hub.html b/main/_modules/torch/hub.html
index 6b895740ff..c921615ec5 100644
--- a/main/_modules/torch/hub.html
+++ b/main/_modules/torch/hub.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit.html b/main/_modules/torch/jit.html
index 947036338f..4572d4c21a 100644
--- a/main/_modules/torch/jit.html
+++ b/main/_modules/torch/jit.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit/_async.html b/main/_modules/torch/jit/_async.html
index 6b82a304bf..bedba90275 100644
--- a/main/_modules/torch/jit/_async.html
+++ b/main/_modules/torch/jit/_async.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit/_freeze.html b/main/_modules/torch/jit/_freeze.html
index 11b5c52651..ad0fee0c50 100644
--- a/main/_modules/torch/jit/_freeze.html
+++ b/main/_modules/torch/jit/_freeze.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit/_fuser.html b/main/_modules/torch/jit/_fuser.html
index 64a62c6739..7e5eeadb74 100644
--- a/main/_modules/torch/jit/_fuser.html
+++ b/main/_modules/torch/jit/_fuser.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit/_script.html b/main/_modules/torch/jit/_script.html
index 177762382c..645a53e7c1 100644
--- a/main/_modules/torch/jit/_script.html
+++ b/main/_modules/torch/jit/_script.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit/_serialization.html b/main/_modules/torch/jit/_serialization.html
index 25fa1dc70a..5624afc12a 100644
--- a/main/_modules/torch/jit/_serialization.html
+++ b/main/_modules/torch/jit/_serialization.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/jit/_trace.html b/main/_modules/torch/jit/_trace.html
index 523b6c199b..00dcb949a5 100644
--- a/main/_modules/torch/jit/_trace.html
+++ b/main/_modules/torch/jit/_trace.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/library.html b/main/_modules/torch/library.html
index 03fc676475..99ca1b3c1b 100644
--- a/main/_modules/torch/library.html
+++ b/main/_modules/torch/library.html
@@ -280,7 +280,7 @@
@@ -552,7 +552,6 @@ Source code for torch.library
"fallthrough_kernel",
"impl_abstract",
"register_fake",
- "register_torch_dispatch",
"get_ctx",
"custom_op",
]
@@ -706,27 +705,6 @@ Source code for torch.library
handle = entry.fake_impl.register(func_to_register, source)
self._registration_handles.append(handle)
- def _register_torch_dispatch_rule(self, op_name, torch_dispatch_class, fn):
- r"""Registers a torch_dispatch rule for the given operator and torch_dispatch_class.
-
- This allows for open registration to specify the behavior between the operator
- and the torch_dispatch_class without needing to modify the torch_dispatch_class
- or the operator directly.
-
- The torch_dispatch_class is either a Tensor subclass with `__torch_dispatch__` or a
- TorchDispatchMode.
-
- If it is a Tensor subclass, we expect fn to have the following signature:
- (cls, func: OpOverload, types: Tuple[type, ...], args, kwargs) -> Any
-
- If it is a TorchDispatchMode, we expect fn to have the following signature:
- (mode, func: OpOverload, types: Tuple[type, ...], args, kwargs) -> Any
- """
- qualname = f"{self.ns}::{op_name}"
- entry = torch._library.simple_registry.singleton.find(qualname)
- handle = entry.torch_dispatch_rules.register(torch_dispatch_class, fn)
- self._registration_handles.append(handle)
-
def _impl_with_aoti_compile(self, op_name, dispatch_key=""):
r"""Register the operator to use the AOTI-compiled implementation.
@@ -1396,87 +1374,6 @@ Source code for torch.library
lib.impl(opname, autograd_kernel, "Autograd", with_keyset=True)
-[docs]def register_torch_dispatch(
- op: _op_identifier,
- torch_dispatch_class: Any,
- func: Optional[Callable] = None,
- /,
- *,
- lib: Optional[Library] = None,
-):
- r"""Registers a torch_dispatch rule for the given operator and ``torch_dispatch_class``.
-
- This allows for open registration to specify the behavior between the operator
- and the ``torch_dispatch_class`` without needing to modify the ``torch_dispatch_class``
- or the operator directly.
-
- The ``torch_dispatch_class`` is either a Tensor subclass with ``__torch_dispatch__`` or a
- TorchDispatchMode.
-
- If it is a Tensor subclass, we expect ``func`` to have the following signature:
- ``(cls, func: OpOverload, types: Tuple[type, ...], args, kwargs) -> Any``
-
- If it is a TorchDispatchMode, we expect ``func`` to have the following signature:
- ``(mode, func: OpOverload, types: Tuple[type, ...], args, kwargs) -> Any``
-
- ``args`` and ``kwargs`` will have been normalized the same way they are
- in ``__torch_dispatch__`` (see :ref:`torch-dispatch-calling-convention`).
-
- Examples:
-
- >>> import torch
- >>>
- >>> @torch.library.custom_op("mylib::foo", mutates_args={})
- >>> def foo(x: torch.Tensor) -> torch.Tensor:
- >>> return x.clone()
- >>>
- >>> class MyMode(torch.utils._python_dispatch.TorchDispatchMode):
- >>> def __torch_dispatch__(self, func, types, args=(), kwargs=None):
- >>> return func(*args, **kwargs)
- >>>
- >>> @torch.library.register_torch_dispatch("mylib::foo", MyMode)
- >>> def _(mode, func, types, args, kwargs):
- >>> x, = args
- >>> return x + 1
- >>>
- >>> x = torch.randn(3)
- >>> y = foo(x)
- >>> assert torch.allclose(y, x)
- >>>
- >>> with MyMode():
- >>> y = foo(x)
- >>> assert torch.allclose(y, x + 1)
-
- """
- if not isinstance(
- op, (str, torch._ops.OpOverload, torch._library.custom_ops.CustomOpDef)
- ):
- raise ValueError(
- "register_torch_dispatch(op): got unexpected type for op: {type(op)}"
- )
- if isinstance(op, torch._ops.OpOverload):
- op = op._name
- opdef = _maybe_get_opdef(op)
- if opdef is not None:
- return opdef.register_torch_dispatch(torch_dispatch_class, func)
- assert isinstance(op, str)
-
- def register(func):
- namespace, op_name = torch._library.utils.parse_namespace(op)
- if lib is None:
- use_lib = Library(namespace, "FRAGMENT")
- _keep_alive.append(use_lib)
- else:
- use_lib = lib
- use_lib._register_torch_dispatch_rule(op_name, torch_dispatch_class, func)
- return func
-
- if func is None:
- return register
- else:
- return register(func)
-
-
# If the op was defined in C++, then we want to make sure there was an
# m.set_python_module(module, ...) call and that the module is the
# same as the module that called torch.library.register_fake.
diff --git a/main/_modules/torch/monitor.html b/main/_modules/torch/monitor.html
index 56a2ee75e3..ca93af9420 100644
--- a/main/_modules/torch/monitor.html
+++ b/main/_modules/torch/monitor.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/mps.html b/main/_modules/torch/mps.html
index 0b59578865..272da62938 100644
--- a/main/_modules/torch/mps.html
+++ b/main/_modules/torch/mps.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/mps/event.html b/main/_modules/torch/mps/event.html
index f044309176..e2cb08f95e 100644
--- a/main/_modules/torch/mps/event.html
+++ b/main/_modules/torch/mps/event.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/mps/profiler.html b/main/_modules/torch/mps/profiler.html
index 4e415bafe1..f96d568229 100644
--- a/main/_modules/torch/mps/profiler.html
+++ b/main/_modules/torch/mps/profiler.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/mtia.html b/main/_modules/torch/mtia.html
index 691c0f0dc5..8ef789747f 100644
--- a/main/_modules/torch/mtia.html
+++ b/main/_modules/torch/mtia.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/multiprocessing.html b/main/_modules/torch/multiprocessing.html
index 52f5b0193f..19b4fa743a 100644
--- a/main/_modules/torch/multiprocessing.html
+++ b/main/_modules/torch/multiprocessing.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/multiprocessing/spawn.html b/main/_modules/torch/multiprocessing/spawn.html
index a363a64c0e..e2cc5703c3 100644
--- a/main/_modules/torch/multiprocessing/spawn.html
+++ b/main/_modules/torch/multiprocessing/spawn.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nested.html b/main/_modules/torch/nested.html
index cb506a1659..9120dcc30a 100644
--- a/main/_modules/torch/nested.html
+++ b/main/_modules/torch/nested.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/attention.html b/main/_modules/torch/nn/attention.html
index 36f57841cc..4529ef92eb 100644
--- a/main/_modules/torch/nn/attention.html
+++ b/main/_modules/torch/nn/attention.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/attention/bias.html b/main/_modules/torch/nn/attention/bias.html
index d171c0316e..1f21a051b3 100644
--- a/main/_modules/torch/nn/attention/bias.html
+++ b/main/_modules/torch/nn/attention/bias.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/functional.html b/main/_modules/torch/nn/functional.html
index 8840d57467..1c6457f570 100644
--- a/main/_modules/torch/nn/functional.html
+++ b/main/_modules/torch/nn/functional.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/init.html b/main/_modules/torch/nn/init.html
index 6db29c98fc..a8f1c88f57 100644
--- a/main/_modules/torch/nn/init.html
+++ b/main/_modules/torch/nn/init.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/activation.html b/main/_modules/torch/nn/modules/activation.html
index f1390c1a03..6388ea6fd7 100644
--- a/main/_modules/torch/nn/modules/activation.html
+++ b/main/_modules/torch/nn/modules/activation.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/adaptive.html b/main/_modules/torch/nn/modules/adaptive.html
index aee3dd121c..5597458572 100644
--- a/main/_modules/torch/nn/modules/adaptive.html
+++ b/main/_modules/torch/nn/modules/adaptive.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/batchnorm.html b/main/_modules/torch/nn/modules/batchnorm.html
index d1f5c534b9..dd632f2427 100644
--- a/main/_modules/torch/nn/modules/batchnorm.html
+++ b/main/_modules/torch/nn/modules/batchnorm.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/channelshuffle.html b/main/_modules/torch/nn/modules/channelshuffle.html
index 4d7521963b..b8fc2b0f90 100644
--- a/main/_modules/torch/nn/modules/channelshuffle.html
+++ b/main/_modules/torch/nn/modules/channelshuffle.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/container.html b/main/_modules/torch/nn/modules/container.html
index 3b58f27036..d1cd81b68c 100644
--- a/main/_modules/torch/nn/modules/container.html
+++ b/main/_modules/torch/nn/modules/container.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/conv.html b/main/_modules/torch/nn/modules/conv.html
index 62af657d6a..40a2820970 100644
--- a/main/_modules/torch/nn/modules/conv.html
+++ b/main/_modules/torch/nn/modules/conv.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/distance.html b/main/_modules/torch/nn/modules/distance.html
index 3bff459ec2..fe70f0cfda 100644
--- a/main/_modules/torch/nn/modules/distance.html
+++ b/main/_modules/torch/nn/modules/distance.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/dropout.html b/main/_modules/torch/nn/modules/dropout.html
index 4f1a15f965..03bb8e5222 100644
--- a/main/_modules/torch/nn/modules/dropout.html
+++ b/main/_modules/torch/nn/modules/dropout.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/flatten.html b/main/_modules/torch/nn/modules/flatten.html
index 4eac83a3f4..879c8ef86f 100644
--- a/main/_modules/torch/nn/modules/flatten.html
+++ b/main/_modules/torch/nn/modules/flatten.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/fold.html b/main/_modules/torch/nn/modules/fold.html
index 45934b25ad..c4f3417551 100644
--- a/main/_modules/torch/nn/modules/fold.html
+++ b/main/_modules/torch/nn/modules/fold.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/instancenorm.html b/main/_modules/torch/nn/modules/instancenorm.html
index c43f40f73f..24f616d073 100644
--- a/main/_modules/torch/nn/modules/instancenorm.html
+++ b/main/_modules/torch/nn/modules/instancenorm.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/lazy.html b/main/_modules/torch/nn/modules/lazy.html
index 765e43e3a4..2abf20e45f 100644
--- a/main/_modules/torch/nn/modules/lazy.html
+++ b/main/_modules/torch/nn/modules/lazy.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/linear.html b/main/_modules/torch/nn/modules/linear.html
index bc1fbbdd7c..61677f2493 100644
--- a/main/_modules/torch/nn/modules/linear.html
+++ b/main/_modules/torch/nn/modules/linear.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/loss.html b/main/_modules/torch/nn/modules/loss.html
index f3f2741ae4..9abdf6108b 100644
--- a/main/_modules/torch/nn/modules/loss.html
+++ b/main/_modules/torch/nn/modules/loss.html
@@ -280,7 +280,7 @@
diff --git a/main/_modules/torch/nn/modules/module.html b/main/_modules/torch/nn/modules/module.html
index 7fbe990032..cbcfd69d13 100644
--- a/main/_modules/torch/nn/modules/module.html
+++ b/main/_modules/torch/nn/modules/module.html
@@ -280,7 +280,7 @@
-