summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Zou <zou3519@users.noreply.github.com>2021-09-24 13:29:08 -0400
committerGitHub <noreply@github.com>2021-09-24 10:29:08 -0700
commit0e857bf1092e0245925f6de596f7cb38de88cc23 (patch)
tree68b0ea601699cabe2734f2d7fdb2d3ba708a9e31
parentad22804b952afde13e92fce321b310764b2147d1 (diff)
downloadpytorch-0e857bf1092e0245925f6de596f7cb38de88cc23.tar.gz
pytorch-0e857bf1092e0245925f6de596f7cb38de88cc23.tar.bz2
pytorch-0e857bf1092e0245925f6de596f7cb38de88cc23.zip
[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.
-rw-r--r--docs/source/torch.rst1
-rw-r--r--test/test_vmap.py3
-rw-r--r--torch/__init__.py2
3 files changed, 2 insertions, 4 deletions
diff --git a/docs/source/torch.rst b/docs/source/torch.rst
index 084dad3490..c828f0ecbf 100644
--- a/docs/source/torch.rst
+++ b/docs/source/torch.rst
@@ -597,5 +597,4 @@ Utilities
are_deterministic_algorithms_enabled
set_warn_always
is_warn_always_enabled
- vmap
_assert
diff --git a/test/test_vmap.py b/test/test_vmap.py
index 35b28db84f..6f6996b09b 100644
--- a/test/test_vmap.py
+++ b/test/test_vmap.py
@@ -1,7 +1,8 @@
from torch.testing._internal.common_utils import TestCase, run_tests
import torch
import torch.nn.functional as F
-from torch import Tensor, vmap
+from torch import Tensor
+from torch._vmap_internals import vmap
import functools
import itertools
import warnings
diff --git a/torch/__init__.py b/torch/__init__.py
index 18c9b08a8b..abd8c1f918 100644
--- a/torch/__init__.py
+++ b/torch/__init__.py
@@ -756,8 +756,6 @@ del register_after_fork
# torch.jit.script as a decorator, for instance):
from ._lobpcg import lobpcg as lobpcg
-from ._vmap_internals import vmap as vmap
-
# These were previously defined in native_functions.yaml and appeared on the
# `torch` namespace, but we moved them to c10 dispatch to facilitate custom
# class usage. We add these lines here to preserve backward compatibility.