Skip to content

Commit 0e857bf

Browse files
authored
[1.10] Remove torch.vmap (#65496)
torch.vmap is a prototype feature and should not be in the stable binary. This PR: - Removes the torch.vmap API - Removes the documentation entry for torch.vmap - Changes the vmap tests to use an internal API instead of torch.vmap. Test Plan: - Tested locally (test_torch, test_autograd, test_type_hints, test_vmap), but also wait for CI.
1 parent ad22804 commit 0e857bf

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

docs/source/torch.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,5 +597,4 @@ Utilities
597597
are_deterministic_algorithms_enabled
598598
set_warn_always
599599
is_warn_always_enabled
600-
vmap
601600
_assert

test/test_vmap.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from torch.testing._internal.common_utils import TestCase, run_tests
22
import torch
33
import torch.nn.functional as F
4-
from torch import Tensor, vmap
4+
from torch import Tensor
5+
from torch._vmap_internals import vmap
56
import functools
67
import itertools
78
import warnings

torch/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,6 @@ def compiled_with_cxx11_abi():
756756
# torch.jit.script as a decorator, for instance):
757757
from ._lobpcg import lobpcg as lobpcg
758758

759-
from ._vmap_internals import vmap as vmap
760-
761759
# These were previously defined in native_functions.yaml and appeared on the
762760
# `torch` namespace, but we moved them to c10 dispatch to facilitate custom
763761
# class usage. We add these lines here to preserve backward compatibility.

0 commit comments

Comments
 (0)