blob: 03da51c1c49e0578daea3b49f251445a2fc25681 [file] [log] [blame]
#pragma once
#include <torch/csrc/python_headers.h>
#include <c10/core/TensorImpl.h>
namespace torch { namespace autograd {
struct TORCH_API PythonMode {
// Enter python mode, causing all operators to dispatch to the type's __torch_dispatch__.
// `type` is the type of a Tensor subclass that has __torch_dispatch__.
static void enter(PyObject* type);
// Exit the current python mode.
static void exit();
};
}}